Skip to contentSkip to conversation

hw/nvme: fix example serial in documentation

PATCH In review Niklas Cassel via 3 participants 4 messages Jun 27, 2022 – Jun 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/nvme: fix example serial in documentation

The serial prop on the controller is actually describing the nvme subsystem serial, which has to be identical for all controllers within the same nvme subsystem.

This is enforced since commit a859eb9f8f64 ("hw/nvme: enforce common serial per subsystem").

Fix the documentation, so that people copying the qemu command line example won't get an error on qemu start.

---
 docs/system/devices/nvme.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/system/devices/nvme.rst +2 -2
index aba253304e..30f841ef62 100644
@@ -104,8 +104,8 @@ multipath I/O.
 .. code-block:: console
 
    -device nvme-subsys,id=nvme-subsys-0,nqn=subsys0
-   -device nvme,serial=a,subsys=nvme-subsys-0
-   -device nvme,serial=b,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
 
 This will create an NVM subsystem with two controllers. Having controllers
 linked to an ``nvme-subsys`` device allows additional ``nvme-ns`` parameters:
Signature · 1 line
2.36.1
#1 lore raw
Quoted 33 lines · Niklas Cassel

The serial prop on the controller is actually describing the nvme subsystem serial, which has to be identical for all controllers within the same nvme subsystem.

This is enforced since commit a859eb9f8f64 ("hw/nvme: enforce common serial per subsystem").

Fix the documentation, so that people copying the qemu command line example won't get an error on qemu start.

---
 docs/system/devices/nvme.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/system/devices/nvme.rst +2 -2
index aba253304e..30f841ef62 100644
@@ -104,8 +104,8 @@ multipath I/O.
 .. code-block:: console
 
    -device nvme-subsys,id=nvme-subsys-0,nqn=subsys0
-   -device nvme,serial=a,subsys=nvme-subsys-0
-   -device nvme,serial=b,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
 
 This will create an NVM subsystem with two controllers. Having controllers
 linked to an ``nvme-subsys`` device allows additional ``nvme-ns`` parameters:
Signature · 1 line
2.36.1

Woops!

Thanks Niklas, applied to nvme-next!

#2 lore raw
In reply to Niklas Cassel via
Quoted 3 lines · Niklas Cassel via

The serial prop on the controller is actually describing the nvme subsystem serial, which has to be identical for all controllers within the same nvme subsystem.

Given this description...

Quoted 2 lines

-device nvme-subsys,id=nvme-subsys-0,nqn=subsys0

...I'm wondering why 'serial' isn't a property of this device..

docs/system/devices/nvme.rst multipath I/O. · line 108

Quoted 4 lines
docs/system/devices/nvme.rst +2 -2
-   -device nvme,serial=a,subsys=nvme-subsys-0
-   -device nvme,serial=b,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0

..rather than requiring it to be redundantly set to the same value here ?

With regards,
Daniel

Signature · 3 lines
|: 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 :|
#3 lore raw
Quoted 10 lines · Daniel P. Berrangé
Quoted 3 lines · Niklas Cassel via

The serial prop on the controller is actually describing the nvme subsystem serial, which has to be identical for all controllers within the same nvme subsystem.

Given this description...

Quoted 2 lines

-device nvme-subsys,id=nvme-subsys-0,nqn=subsys0

Quoted 9 lines

...I'm wondering why 'serial' isn't a property of this device..

docs/system/devices/nvme.rst multipath I/O. · line 108

Quoted 4 lines
docs/system/devices/nvme.rst +2 -2
-   -device nvme,serial=a,subsys=nvme-subsys-0
-   -device nvme,serial=b,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0
+   -device nvme,serial=deadbeef,subsys=nvme-subsys-0

..rather than requiring it to be redundantly set to the same value here ?

-device nvme can be used without a subsystem device, and in that case the serial must be set. However, you are right that we could not require it if set on the subsystem device.