From 02a271f2205f8e8a8aab849ac8455ed3afe3a9ef Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 27 Feb 2007 15:22:13 +0000 Subject: [PATCH] Don't hardcode port=5900+domid for new xend --- ChangeLog | 7 +++++++ src/xend_internal.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48199cecc5..1aa3241571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Feb 27 10:20:43 EST 2007 Daniel P. Berrange + + * 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 * qemud/conf.c, qemud/uuid.[ch]: move qemudParseUUID() diff --git a/src/xend_internal.c b/src/xend_internal.c index 693c971bfe..bb42bc67da 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -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, " \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, " \n", port, listenAddr);