From: "Daniel P. Berrange" <berrange@redhat.com>
To: li guang <lig.fnst@cn.fujitsu.com>
Cc: libvir-list@redhat.com, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [libvirt] [PATCH v2 1/2] add pci-bridge controller type
Date: Tue, 8 Jan 2013 08:51:11 +0000 [thread overview]
Message-ID: <20130108085110.GE4038@redhat.com> (raw)
In-Reply-To: <1357634860.27526.3.camel@liguang.fnst.cn.fujitsu.com>
On Tue, Jan 08, 2013 at 04:47:40PM +0800, li guang wrote:
> 在 2013-01-08二的 16:37 +0800,li guang写道:
> > 在 2013-01-08二的 08:04 +0000,Daniel P. Berrange写道:
> > > On Tue, Jan 08, 2013 at 09:58:49AM +0800, liguang wrote:
> > > > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> > > > ---
> > > > 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.
> >
> > Oh, yes, this version 'bridge' is unnecessary.
> >
> > In former version, I want to discriminate if a pci device want to
> > sitting on default bus pci.0 or pci-bridge0, so bring in 'bridge'.
> >
> > Thanks!
>
> but, without 'bridge', can't know if user want or don't want pci-bridge,
> and the check for 'bus != 0' will be removed, then if user happened to
> define a pci device greater than 0, qemu will complain about this,
> so it's inconvenient for this case.
The check for 'bus != 0' was only added because we didn't have any
support for bridges. Once we have bridge support, then that check
can be changed. If bus != 0, then check to see if there's a matching
bridge device, otherwise raise an error.
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 :|
next prev parent reply other threads:[~2013-01-08 8:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 1:58 [Qemu-devel] [libvirt][PATCH v2 0/2] add pci-bridge support liguang
2013-01-08 1:58 ` [Qemu-devel] [libvirt][PATCH v2 1/2] add pci-bridge controller type liguang
2013-01-08 4:38 ` Doug Goldstein
2013-01-08 5:26 ` li guang
2013-01-08 8:04 ` [Qemu-devel] [libvirt] [PATCH " Daniel P. Berrange
2013-01-08 8:37 ` li guang
2013-01-08 8:47 ` li guang
2013-01-08 8:51 ` Daniel P. Berrange [this message]
2013-01-08 8:55 ` li guang
2013-01-08 8:59 ` Daniel P. Berrange
2013-01-08 1:58 ` [Qemu-devel] [libvirt][PATCH v2 2/2] build command line for pci-bridge device of qemu liguang
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=20130108085110.GE4038@redhat.com \
--to=berrange@redhat.com \
--cc=libvir-list@redhat.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).