qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Vincent Bernat <vincent@bernat.ch>
Cc: Igor Mammedov <imammedo@redhat.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41
Date: Thu, 1 Apr 2021 11:19:09 +0100	[thread overview]
Message-ID: <YGWeHXMPIbbI5wWA@redhat.com> (raw)
In-Reply-To: <m3wntmjp25.fsf@bernat.ch>

On Thu, Apr 01, 2021 at 12:07:30PM +0200, Vincent Bernat wrote:
>  ❦  1 avril 2021 10:38 +01, Daniel P. Berrangé:
> 
> >>  hw/smbios/smbios.c | 47 +++++++++++++++++++++-------------------------
> >>  qemu-options.hx    |  2 +-
> >>  2 files changed, 22 insertions(+), 27 deletions(-)
> >
> > It doesn't really make sense to have this as a separate patch
> > when it is deleting half the code you added in the previous
> > patch. Just merge them together as one.
> 
> I'll do that.
> 
> >> +                /*
> >> +                 * TODO: Extract the appropriate value. Most of the
> >> +                 * time, this will be 0.
> >> +                 */
> >> +                t->segment_group_number = cpu_to_le16(0);
> >
> > Hmm, tricky, as it requires interpreting the PCI topology. Wonder if
> > there's any helper that can do the hard work for you
> 
> There is pci_root_bus_path(), but it returns a string which could just
> contain a segment or several segments. It seems the SMBIOS standard
> didn't account for complex topologies. I could parse the string. and
> keep only the right-most segment.
> 
> >> +                t->bus_number = pci_dev_bus_num(pdev);
> >> +                t->device_number = pdev->devfn;
> >> +            } else {
> >> +                fprintf(stderr, "%s: cannot find PCI device %s\n",
> >> +                        __func__, t41->pcidev);
> >
> > This isn't terminating execution which looks like a bug.
> 
> It was my intention. The PCI address will then be 00:00:00.0. If you
> think it's better to terminate, I can do what you suggest.

If we can't find the PCI device, that's user configuration error, and
we prefer to report those & exit, rather than continuing with likely
bogus data.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2021-04-01 10:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  8:25 [PATCH v2 1/2] hw/smbios: support for type 41 (onboard devices extended information) Vincent Bernat
2021-04-01  8:25 ` [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41 Vincent Bernat
2021-04-01  9:38   ` Daniel P. Berrangé
2021-04-01 10:07     ` Vincent Bernat
2021-04-01 10:19       ` Daniel P. Berrangé [this message]
2021-04-01 12:27     ` Vincent Bernat
2021-04-01 13:59   ` Michael S. Tsirkin
2021-04-01 14:26     ` Vincent Bernat
2021-04-01 16:32       ` Michael S. Tsirkin
2021-04-01  8:41 ` [PATCH v2 1/2] hw/smbios: support for type 41 (onboard devices extended information) Daniel P. Berrangé
2021-04-01  8:46   ` Vincent Bernat

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=YGWeHXMPIbbI5wWA@redhat.com \
    --to=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vincent@bernat.ch \
    /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).