Skip to contentSkip to conversation

autoport overrides actual VNC port number in dump-xml

PATCH In review Charles Duffy 2 participants 2 messages Jul 30, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autoport overrides actual VNC port number in dump-xml

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.

src/domain_conf.c +3 -3
index d629093..ece471e 100644
@@ -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");
#1 lore raw
Quoted 4 lines · 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.

You've got the wrong mailing list here - you want the libvirt list at [email protected]

Regards,
Daniel

Signature · 4 lines
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|