All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Auger Eric <eric.auger@redhat.com>,
	eric.auger.pro@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] vfio/pci: conversion to realize
Date: Tue, 13 Sep 2016 08:25:56 +0200	[thread overview]
Message-ID: <878tuwiadn.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20160912101722.149f3a8a@t450s.home> (Alex Williamson's message of "Mon, 12 Sep 2016 10:17:22 -0600")

Alex Williamson <alex.williamson@redhat.com> writes:

> On Mon, 12 Sep 2016 16:00:18 +0200
> Auger Eric <eric.auger@redhat.com> wrote:
>
>> Hi Markus,
>> 
>> On 12/09/2016 14:45, Markus Armbruster wrote:
>> > Eric Auger <eric.auger@redhat.com> writes:
>> >   
>> >> This patch converts VFIO PCI to realize function.
>> >>
>> >> Also original initfn errors now are propagated using QEMU
>> >> error objects. All errors are formatted with the same pattern:
>> >> "vfio: %s: the error description"  
>> > 
>> > Example:
>> > 
>> > $ upstream-qemu -device vfio-pci
>> > upstream-qemu: -device vfio-pci: vfio: 0000:00:00.0: no iommu_group found: Unknown error -2
>> > 
>> > Two remarks:
>> > 
>> > * "Unknown error -2" should be "No such file or directory".  See below.  
>> Hum. I noticed that but I didn't have the presence of mind to get it was
>> due to -errno!
>> > 
>> > * Five colons, not counting the ones in the PCI address.  Do we need the
>> >   "vfio: 0000:00:00.0:" part?  If yes, could we find a nicer way to
>> >   print it?  Up to you.  
>> Well we have quite a lot of traces with such format, hence my choice.
>> Alex do you want to change this?
>
> Well, we need to identify the component with the error, it's not
> uncommon to have multiple assigned devices.  The PCI address is just
> the basename in vfio code, it might also be the name of a device node
> in sysfs, such as a uuid of an mdev devices.  AFAIK we cannot count on
> a id and even if we could libvirt assigns them based on order in the
> xml, making them a bit magic.  Maybe I'm not understanding the
> question.  Regarding trace vs error message, I expect that it's going
> to be a more advanced user/developer enabling tracing, error reports
> should try a little harder to be comprehensible to an average user.

Yes, the error message needs to identify the part that's wrong.
However, we need to consider the *complete* error message to judge it.
Consider:

    $ upstream-qemu -device vfio-pci
    upstream-qemu: -device vfio-pci: vfio: 0000:00:00.0: no iommu_group found: No such file or directory

Which parts are actually useful for the user?  "-device vfio-pci"
identifies the part that's wrong.  "vfio: 0000:00:00.0" is gobbledygook
unless you're somewhat familiar with vfio, and then it's redundant.

The "vfio: 0000:00:00.0" *is* useful in messages outside realize()
context, because then the system can't prefix the "-device vfio-pci"
part.

>> > Always, always, always test your error messages :)

Because what you think you see in the code may differ from what the user
will see.

Anyway, your choice, I'm just giving feedback on the error messages I
observe in testing.

[...]

  parent reply	other threads:[~2016-09-13  6:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  7:11 [Qemu-devel] [PATCH 0/3] Convert VFIO-PCI to realize Eric Auger
2016-09-06  7:11 ` [Qemu-devel] [PATCH 1/3] vfio/pci: conversion " Eric Auger
2016-09-12 12:45   ` Markus Armbruster
2016-09-12 14:00     ` Auger Eric
2016-09-12 16:17       ` Alex Williamson
2016-09-12 19:39         ` Auger Eric
2016-09-12 20:05           ` Alex Williamson
2016-09-12 20:51             ` Auger Eric
2016-09-13  6:25         ` Markus Armbruster [this message]
2016-09-13  7:21           ` Auger Eric
2016-09-13 15:03             ` Alex Williamson
2016-09-06  7:11 ` [Qemu-devel] [PATCH 2/3] vfio/pci: pass an error object to vfio_populate_device Eric Auger
2016-09-12 12:51   ` Markus Armbruster
2016-09-12 15:15     ` Auger Eric
2016-09-12 15:50       ` Markus Armbruster
2016-09-12 15:52         ` Auger Eric
2016-09-06  7:11 ` [Qemu-devel] [PATCH 3/3] vfio/pci: pass an error object to vfio_msix_early_setup Eric Auger
2016-09-12 12:58   ` Markus Armbruster
2016-09-12 15:15     ` Auger Eric

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=878tuwiadn.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.