From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsUAS-0005AK-GC for qemu-devel@nongnu.org; Tue, 08 Jan 2013 03:04:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsUAR-0003YO-1s for qemu-devel@nongnu.org; Tue, 08 Jan 2013 03:04:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsUAQ-0003YA-Qf for qemu-devel@nongnu.org; Tue, 08 Jan 2013 03:04:14 -0500 Date: Tue, 8 Jan 2013 08:04:03 +0000 From: "Daniel P. Berrange" Message-ID: <20130108080403.GA4038@redhat.com> References: <1357610330-10835-1-git-send-email-lig.fnst@cn.fujitsu.com> <1357610330-10835-2-git-send-email-lig.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1357610330-10835-2-git-send-email-lig.fnst@cn.fujitsu.com> Subject: Re: [Qemu-devel] [libvirt] [PATCH v2 1/2] add pci-bridge controller type Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liguang Cc: libvir-list@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On Tue, Jan 08, 2013 at 09:58:49AM +0800, liguang wrote: > Signed-off-by: liguang > --- > src/conf/device_conf.c | 12 +++++++++++- > src/conf/device_conf.h | 1 + > src/conf/domain_conf.c | 5 ++++- > src/conf/domain_conf.h | 1 + > 4 files changed, 17 insertions(+), 2 deletions(-) > > diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c > index 7b97f45..1c06ed0 100644 > --- a/src/conf/device_conf.c > +++ b/src/conf/device_conf.c > @@ -51,16 +51,18 @@ int > virDevicePCIAddressParseXML(xmlNodePtr node, > virDevicePCIAddressPtr addr) > { > - char *domain, *slot, *bus, *function, *multi; > + char *domain, *slot, *bus, *function, *multi, *bridge; > int ret = -1; > > memset(addr, 0, sizeof(*addr)); > + addr->bridge = -1; > > domain = virXMLPropString(node, "domain"); > bus = virXMLPropString(node, "bus"); > slot = virXMLPropString(node, "slot"); > function = virXMLPropString(node, "function"); > multi = virXMLPropString(node, "multifunction"); > + bridge = virXMLPropString(node, "bridge"); > > if (domain && > virStrToLong_ui(domain, NULL, 0, &addr->domain) < 0) { > @@ -98,6 +100,14 @@ virDevicePCIAddressParseXML(xmlNodePtr node, > goto cleanup; > > } > + > + if (bridge && > + virStrToLong_i(bridge, NULL, 0, &addr->bridge) < 0) { > + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > + _("pci-bridge number must be >= 0 ")); > + goto cleanup; > + } This is bogus - there's no need for a new 'bridge' attribute - we have 'bus' which is sufficient. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|