From: Vincent Bernat <vincent@bernat.ch>
To: "Daniel P. Berrangé" <berrange@redhat.com>
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, 01 Apr 2021 14:27:06 +0200 [thread overview]
Message-ID: <m3sg4ajilh.fsf@bernat.ch> (raw)
In-Reply-To: <YGWUrw9wgOI1E3aN@redhat.com> ("Daniel P. =?utf-8?Q?Berrang?= =?utf-8?Q?=C3=A9=22's?= message of "Thu, 1 Apr 2021 10:38:55 +0100")
❦ 1 avril 2021 10:38 +01, Daniel P. Berrangé:
>> + 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.
>
> Modify this method to have an 'Error **errp' parameter and
> use 'error_setg' to report it. You'll need to modify the
> smbios_get_tables caller to have an 'Error **errp' too.
>
> For the callers of smbios_get_tables(), you can then just pass
> in '&error_fatal', to make it print the error + exit.
I did that. I wanted to also return -1, but it would require to tweak a
bit more code, notably the SMBIOS_BUILD_TABLE_PRE() macro. As the
callers are using error_fatal, I suppose this is not strictly mandatory
to signal the error through a return code.
--
Have a place for everything and keep the thing somewhere else; this is not
advice, it is merely custom.
-- Mark Twain
next prev parent reply other threads:[~2021-04-01 12:28 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é
2021-04-01 12:27 ` Vincent Bernat [this message]
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=m3sg4ajilh.fsf@bernat.ch \
--to=vincent@bernat.ch \
--cc=berrange@redhat.com \
--cc=imammedo@redhat.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).