qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/11] NVMe: Initial commit for NVM Express devi


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 01/11] NVMe: Initial commit for NVM Express device
Date: Wed, 27 Feb 2013 10:48:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 27/02/2013 10:30, Andreas Färber ha scritto:
>> > +    id->vwc     = 1;
>> > +    snprintf((char *)id->mn, sizeof(id->mn), "QEMU NVMe Ctrl");
>> > +    snprintf((char *)id->fr, sizeof(id->fr), "1.0");
>> > +    snprintf((char *)id->sn, sizeof(id->sn), "NVMeQx10%02x", n->instance);
> Does this linear instance counting cope with hot-plug and hot-unplug as
> expected?

No, it probably doesn't, but it's okay as a default.  Nevertheless, you
should add a -device property to allow customization of the serial
number.  See virtio-blk.c for an example and follow that (either here or
in patch 2).

Also, you need to use strpadcpy.  The specification says "Some
parameters are defined as a string of ASCII characters. [...] The string
is left justified and shall be padded with spaces (ASCII character 20h)
to the right if necessary" (paragraph 1.8 in version 1.1 of the
specification).

Finally, and unrelated to the code above, we usually do not add new "if"
values.  It's enough to have access via if=none & -device.  In any case
it should be a separate patch, so it's easy to drop it if that's the
decision.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]