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.
This commit is contained in:
Chris Lalancette 2008-07-31 12:30:34 +00:00
parent 55e1221686
commit 6f17fb2851
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Thu Jul 31 14:27:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
* 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 <veillard@redhat.com>
* src/qemu_driver.c: patch from Guido Günther, interface stats should

View File

@ -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");