]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't hardcode port=5900+domid for new xend
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 27 Feb 2007 15:22:13 +0000 (15:22 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 27 Feb 2007 15:22:13 +0000 (15:22 +0000)
ChangeLog
src/xend_internal.c

index 48199cecc5f6ce006d13ba5c4283f89b309807da..1aa32415715f0812b343e5eb508ce8d539460028 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Feb 27 10:20:43 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/xend_internal.c: Only hardcode port = 5900+domid if
+       running against old XenD < 3.0.3, because in newer XenD
+       port is guarenteed to be available in XenStore if the VNC
+       server is running.
+
 Mon Feb 26 15:33:08 IST 2007 Mark McLoughlin <markmc@redhat.com>
 
        * qemud/conf.c, qemud/uuid.[ch]: move qemudParseUUID()
index 693c971bfed1f1e06a2cf3e8368432ba495191ff..bb42bc67dae9e7501bb301449f1d697e5df04e14 100644 (file)
@@ -1571,8 +1571,6 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
             } else if (tmp && !strcmp(tmp, "vnc")) {
                 int port = xenStoreDomainGetVNCPort(conn, domid);
                 const char *listenAddr = sexpr_node(node, "device/vfb/vnclisten");
-                if (port == -1)
-                    port = 5900 + domid;
                 if (listenAddr) {
                     virBufferVSprintf(&buf, "    <graphics type='vnc' port='%d' listen='%s'/>\n", port, listenAddr);
                 } else {
@@ -1618,7 +1616,13 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
         if (tmp[0] == '1') {
             int port = xenStoreDomainGetVNCPort(conn, domid);
             const char *listenAddr = sexpr_fmt_node(root, "domain/image/%s/vnclisten", hvm ? "hvm" : "linux");
-            if (port == -1)
+            /* For Xen >= 3.0.3, don't generate a fixed port mapping
+             * because it will almost certainly be wrong ! Just leave
+             * it as -1 which lets caller see that the VNC server isn't
+             * present yet. Subsquent dumps of the XML will eventually
+             * find the port in XenStore once VNC server has started
+             */
+            if (port == -1 && xendConfigVersion < 2)
                 port = 5900 + domid;
             if (listenAddr)
                 virBufferVSprintf(&buf, "    <graphics type='vnc' port='%d' listen='%s'/>\n", port, listenAddr);