From 6f17fb28519cf21136a3185bf8e60885a5038d3c Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 31 Jul 2008 12:30:34 +0000 Subject: [PATCH] From Charles Duffy: Per subject; if autoport is in use for a host, the current virDomainGraphicsDefFormat code always emits "port=-1", even if a port is assigned to the host; this leaves no way for a client to find the VNC port assigned to the host in question. This patches fixes it by putting the vncport in place if there is one, and only putting "-1" if we fail that test. --- ChangeLog | 5 +++++ src/domain_conf.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce0fc84119..304c53a7f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 31 14:27:00 CEST 2008 Chris Lalancette + + * src/domain_conf.c: patch from Charles Duffy to make sure we print + the "real" vncport if it exists instead of -1. + Wed Jul 30 11:18:50 CEST 2008 Daniel Veillard * src/qemu_driver.c: patch from Guido Günther, interface stats should diff --git a/src/domain_conf.c b/src/domain_conf.c index d62909340b..ece471e75c 100644 --- a/src/domain_conf.c +++ b/src/domain_conf.c @@ -2431,11 +2431,11 @@ virDomainGraphicsDefFormat(virConnectPtr conn, switch (def->type) { case VIR_DOMAIN_GRAPHICS_TYPE_VNC: - if (def->data.vnc.autoport) - virBufferAddLit(buf, " port='-1'"); - else if (def->data.vnc.port) + if (def->data.vnc.port) virBufferVSprintf(buf, " port='%d'", def->data.vnc.port); + else if (def->data.vnc.autoport) + virBufferAddLit(buf, " port='-1'"); virBufferVSprintf(buf, " autoport='%s'", def->data.vnc.autoport ? "yes" : "no");