render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Daniel P. Berrange a05e64
diff -rup libvirt-0.2.2.new/src/xend_internal.c libvirt-0.2.2/src/xend_internal.c
Daniel P. Berrange a05e64
--- libvirt-0.2.2.new/src/xend_internal.c	2007-04-15 16:09:10.000000000 -0400
Daniel P. Berrange a05e64
+++ libvirt-0.2.2/src/xend_internal.c	2007-05-03 14:52:42.000000000 -0400
Daniel P. Berrange a05e64
@@ -1676,35 +1676,38 @@ xend_parse_sexp_desc(virConnectPtr conn,
Daniel P. Berrange a05e64
         }
Daniel P. Berrange a05e64
     }
Daniel P. Berrange a05e64
 
Daniel P. Berrange a05e64
-    /* Graphics device (HVM <= 3.0.4, or PV <= 3.0.4) vnc config */
Daniel P. Berrange a05e64
-    tmp = sexpr_fmt_node(root, "domain/image/%s/vnc", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
-    if (tmp != NULL) {
Daniel P. Berrange a05e64
-        if (tmp[0] == '1') {
Daniel P. Berrange a05e64
-            int port = xenStoreDomainGetVNCPort(conn, domid);
Daniel P. Berrange a05e64
-            const char *listenAddr = sexpr_fmt_node(root, "domain/image/%s/vnclisten", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
-            const char *keymap = sexpr_fmt_node(root, "domain/image/%s/keymap", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
-            /* For Xen >= 3.0.3, don't generate a fixed port mapping
Daniel P. Berrange a05e64
-             * because it will almost certainly be wrong ! Just leave
Daniel P. Berrange a05e64
-             * it as -1 which lets caller see that the VNC server isn't
Daniel P. Berrange a05e64
-             * present yet. Subsquent dumps of the XML will eventually
Daniel P. Berrange a05e64
-             * find the port in XenStore once VNC server has started
Daniel P. Berrange a05e64
-             */
Daniel P. Berrange a05e64
-            if (port == -1 && xendConfigVersion < 2)
Daniel P. Berrange a05e64
-                port = 5900 + domid;
Daniel P. Berrange a05e64
-            virBufferVSprintf(&buf, "    
Daniel P. Berrange a05e64
-            if (listenAddr)
Daniel P. Berrange a05e64
-                virBufferVSprintf(&buf, " listen='%s'", listenAddr);
Daniel P. Berrange a05e64
-            if (keymap)
Daniel P. Berrange a05e64
-                virBufferVSprintf(&buf, " keymap='%s'", keymap);
Daniel P. Berrange a05e64
-            virBufferAdd(&buf, "/>\n", 3);
Daniel P. Berrange a05e64
+    /* Graphics device (HVM <= 3.0.4, or PV <= 3.0.3) vnc config */
Daniel P. Berrange a05e64
+    if ((hvm && xendConfigVersion < 4) ||
Daniel P. Berrange a05e64
+        (!hvm && xendConfigVersion < 3)) {
Daniel P. Berrange a05e64
+        tmp = sexpr_fmt_node(root, "domain/image/%s/vnc", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
+        if (tmp != NULL) {
Daniel P. Berrange a05e64
+            if (tmp[0] == '1') {
Daniel P. Berrange a05e64
+                int port = xenStoreDomainGetVNCPort(conn, domid);
Daniel P. Berrange a05e64
+                const char *listenAddr = sexpr_fmt_node(root, "domain/image/%s/vnclisten", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
+                const char *keymap = sexpr_fmt_node(root, "domain/image/%s/keymap", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
+                /* For Xen >= 3.0.3, don't generate a fixed port mapping
Daniel P. Berrange a05e64
+                 * because it will almost certainly be wrong ! Just leave
Daniel P. Berrange a05e64
+                 * it as -1 which lets caller see that the VNC server isn't
Daniel P. Berrange a05e64
+                 * present yet. Subsquent dumps of the XML will eventually
Daniel P. Berrange a05e64
+                 * find the port in XenStore once VNC server has started
Daniel P. Berrange a05e64
+                 */
Daniel P. Berrange a05e64
+                if (port == -1 && xendConfigVersion < 2)
Daniel P. Berrange a05e64
+                    port = 5900 + domid;
Daniel P. Berrange a05e64
+                virBufferVSprintf(&buf, "    
Daniel P. Berrange a05e64
+                if (listenAddr)
Daniel P. Berrange a05e64
+                    virBufferVSprintf(&buf, " listen='%s'", listenAddr);
Daniel P. Berrange a05e64
+                if (keymap)
Daniel P. Berrange a05e64
+                    virBufferVSprintf(&buf, " keymap='%s'", keymap);
Daniel P. Berrange a05e64
+                virBufferAdd(&buf, "/>\n", 3);
Daniel P. Berrange a05e64
+            }
Daniel P. Berrange a05e64
         }
Daniel P. Berrange a05e64
-    }
Daniel P. Berrange a05e64
 
Daniel P. Berrange a05e64
-    /* Graphics device (HVM, or old (pre-3.0.4) style PV sdl config) */
Daniel P. Berrange a05e64
-    tmp = sexpr_fmt_node(root, "domain/image/%s/sdl", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
-    if (tmp != NULL) {
Daniel P. Berrange a05e64
-        if (tmp[0] == '1')
Daniel P. Berrange a05e64
-            virBufferAdd(&buf, "    <graphics type='sdl'/>\n", 27 );
Daniel P. Berrange a05e64
+        /* Graphics device (HVM, or old (pre-3.0.4) style PV sdl config) */
Daniel P. Berrange a05e64
+        tmp = sexpr_fmt_node(root, "domain/image/%s/sdl", hvm ? "hvm" : "linux");
Daniel P. Berrange a05e64
+        if (tmp != NULL) {
Daniel P. Berrange a05e64
+            if (tmp[0] == '1')
Daniel P. Berrange a05e64
+                virBufferAdd(&buf, "    <graphics type='sdl'/>\n", 27 );
Daniel P. Berrange a05e64
+        }
Daniel P. Berrange a05e64
     }
Daniel P. Berrange a05e64
 
Daniel P. Berrange a05e64
     tty = xenStoreDomainGetConsolePath(conn, domid);
Daniel P. Berrange a05e64
Only in libvirt-0.2.2/src: xend_internal.c.orig