Hi,

I have a virtual system created using qemu 7.2. In that system, I
attached/hot plugged a virtual NVMe drive. This drive had a default
block size of 512 bytes.

admin@node-3:~$ sudo nvme list
Node                  SN                   Model
             Namespace Usage                      Format           FW
Rev
--------------------- --------------------
---------------------------------------- ---------
-------------------------- ---------------- --------
/dev/nvme0n1          ashudev-6f34a1cf_13  QEMU NVMe Ctrl
             1          34.36  GB /  34.36  GB    512   B +  0 B
7.1.92

After that, I formatted this drive with 4k block size and it formatted
successfully.

admin@node-3:~$ sudo nvme format /dev/nvme0n1 -f --lbaf 4
Success formatting namespace:1
admin@node-3:~$
admin@node-3:~$ sudo nvme list
Node                  SN                   Model
             Namespace Usage                      Format           FW
Rev
--------------------- --------------------
---------------------------------------- ---------
-------------------------- ---------------- --------
/dev/nvme0n1          ashudev-6f34a1cf_13  QEMU NVMe Ctrl
             1          34.36  GB /  34.36  GB      4 KiB +  0 B
7.1.92

Then, I just performed the hot plugout and then plugin operation on
that drive using qmp.execute's device_del and device_add cmd
respectively.

But, after that, the default block size of that drive reverted to 512 bytes.

admin@node-3:~$ sudo nvme list
Node                  SN                   Model
             Namespace Usage                      Format           FW
Rev
--------------------- --------------------
---------------------------------------- ---------
-------------------------- ---------------- --------
/dev/nvme0n1          ashudev-6f34a1cf_13  QEMU NVMe Ctrl
             1          34.36  GB /  34.36  GB    512   B +  0 B
7.1.92

So, I just wanted to know why the NVMe format type reverted back to
512 bytes, as I just performed the hot plugout/plugin operations only.
Drive's block size (format type) should not be changed upon
removal/insertion, right ? or am I missing something ?

Regards,
Ashutosh

Reply via email to