From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Duffy Subject: [PATCH] autoport overrides actual VNC port number in dump-xml Date: Wed, 30 Jul 2008 00:32:57 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090103050500010408080902" To: kvm@vger.kernel.org Return-path: Received: from main.gmane.org ([80.91.229.2]:48902 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbYG3FdU (ORCPT ); Wed, 30 Jul 2008 01:33:20 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KO4JI-0003BA-25 for kvm@vger.kernel.org; Wed, 30 Jul 2008 05:33:16 +0000 Received: from rrcs-71-41-149-67.sw.biz.rr.com ([71.41.149.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2008 05:33:16 +0000 Received: from Charles_Duffy by rrcs-71-41-149-67.sw.biz.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2008 05:33:16 +0000 Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------090103050500010408080902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------090103050500010408080902 Content-Type: text/x-diff; name="libvirt-fix-vnc-port-output.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libvirt-fix-vnc-port-output.patch" 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"); --------------090103050500010408080902--