From: Markus Armbruster <armbru@redhat.com>
To: Keith Busch <keith.busch@intel.com>
Cc: Bug 1529449 <1529449@bugs.launchpad.net>,
qemu-devel@nongnu.org, Tom Yan <tom.ty89@gmail.com>
Subject: Re: [Qemu-devel] [Bug 1529449] [NEW] serial is required for -device nvme
Date: Tue, 12 Jan 2016 11:12:09 +0100 [thread overview]
Message-ID: <87egdnnm2u.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <20160111195920.GA8743@localhost.localdomain> (Keith Busch's message of "Mon, 11 Jan 2016 19:59:21 +0000")
Keith Busch <keith.busch@intel.com> writes:
> On Mon, Jan 11, 2016 at 05:35:50PM +0100, Markus Armbruster wrote:
>> Tom Yan <tom.ty89@gmail.com> writes:
>> > Public bug reported:
>> >
>> > I am not exactly sure if this is a bug, but I don't see why the option
>> > "serial" should be required for -device nvme like the option "drive".
>> > Truth is it seem to accept random string as its value anyway, if that's
>> > the case, couldn't qemu just generate one for it when it's not
>> > specified?
>>
>> You should've included a reproducer. Here are mine:
>>
>> 1. Bad error reporting on missing drive:
>>
>> $ upstream-qemu -nodefaults -device nvme
>> upstream-qemu: -device nvme: Device initialization failed
>>
>> Expected: error reported like for other devices, e.g.
>>
>> $ upstream-qemu -nodefaults -device virtio-blk
>> upstream-qemu: -device virtio-blk: drive property not set
>>
>> 2. Bad error reporting on empty drive:
>>
>> $ upstream-qemu -nodefaults -drive if=none,id=foo -device nvme,drive=foo
>> upstream-qemu: -device nvme,drive=foo: Device initialization failed
>>
>> Expected: error is reported like for other devices, e.g.
>>
>> $ upstream-qemu -nodefaults -drive if=none,id=foo -device virtio-blk,drive=foo
>> upstream-qemu: -device virtio-blk,drive=foo: Device needs media, but drive is empty
>>
>> 3. Bad handling of missing serial:
>>
>> $ upstream-qemu -nodefaults -drive if=none,id=foo,file=tmp.qcow2 -device nvme,drive=foo
>> upstream-qemu: -device nvme,drive=foo: Device initialization failed
>>
>> Expected: either default the serial number, like some other devices
>> do, or a decent error message.
>>
>> I recommend to convert the device to realize(), and add the missing
>> error_setg(). Keith?
>
> Requiring a serial was a concious choice to push that responsibility
> on the user, but I don't see a problem having the code provide default
> serial string if the user does not over ride it.
>
> If you've multiple nvme devices in your guest, creating the same serial
> could cause problems with multipathing if they're basing end device
> uniqueness on the serial (some do). If we have the code provide the
> serial, perhaps it would be best to make each unique. That's easy enough
> to append an incrementing number to the end of the serial.
I don't have a strong opinion on whether serial can remain mandatory or
should become optional. If we make up serial numbers, they better be
unique, of course.
I do have a strong opinion on something else: the error reporting.
Please convert the device to realize(), and add the necessary
error_setg().
next prev parent reply other threads:[~2016-01-12 10:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 7:03 [Qemu-devel] [Bug 1529449] [NEW] serial is required for -device nvme Tom Yan
2016-01-11 16:35 ` Markus Armbruster
2016-01-11 19:59 ` Keith Busch
2016-01-12 10:12 ` Markus Armbruster [this message]
2016-04-28 18:07 ` [Qemu-devel] [Bug 1529449] " Tom Yan
2016-04-28 19:06 ` Laszlo Ersek (Red Hat)
2016-05-05 9:44 ` Tom Yan
2016-05-05 9:44 ` Tom Yan
2016-05-05 9:45 ` Tom Yan
2020-08-12 12:43 ` Laszlo Ersek (Red Hat)
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=87egdnnm2u.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=1529449@bugs.launchpad.net \
--cc=keith.busch@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=tom.ty89@gmail.com \
/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.