public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Duffy <Charles_Duffy@messageone.com>
To: kvm@vger.kernel.org
Subject: [PATCH] autoport overrides actual VNC port number in dump-xml
Date: Wed, 30 Jul 2008 00:32:57 -0500	[thread overview]
Message-ID: <g6oueh$kcs$1@ger.gmane.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

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.

[-- Attachment #2: libvirt-fix-vnc-port-output.patch --]
[-- Type: text/x-diff, Size: 737 bytes --]

diff --git a/src/domain_conf.c b/src/domain_conf.c
index d629093..ece471e 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");

             reply	other threads:[~2008-07-30  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30  5:32 Charles Duffy [this message]
2008-07-30  9:14 ` [PATCH] autoport overrides actual VNC port number in dump-xml Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g6oueh$kcs$1@ger.gmane.org' \
    --to=charles_duffy@messageone.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox