Bug 901493 - [TestOnly] No ID_SERIAL for virtio-blk devices
[TestOnly] No ID_SERIAL for virtio-blk devices
Status: CLOSED DUPLICATE of bug 877836
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Stefan Hajnoczi
Virtualization Bugs
: TestOnly
Depends On:
  Show dependency treegraph
Reported: 2013-01-18 05:20 EST by Rajendra Kumar
Modified: 2013-01-22 21:16 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-01-22 21:16:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rajendra Kumar 2013-01-18 05:20:22 EST
Description of problem:

Virtio-blk devices does not have ID_SERIAL and no way to uniquely identify virtual devices under guest OS. I tried to add <serial>SERIAL_ID</serial> 
to existing virtio-blk devices using virsh command. I tried this command 
on active and inactive guest but it is failing with different errors. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. setup a guest using virtio-blk disk, without giving a serial id to 
   the disk, this is the default situation. 
2. In guest, run `udevadm info /dev/vda | grep ID_SERIAL`, it returns empty.
3. Create an XML file to update a specific device. To add a line for the 
   source device

   <disk type='file' device='disk'>
        <driver name='qemu' type='raw'/>
        <source file='/var/lib/libvirt/images/mydisk.img'/>
        <target dev='vdb' bus='virtio'/>
        <alias name='virtio-disk1'/>
        <address type='pci' domain='0x0000' bus='0x00' 
                 slot='0x07' function='0x0'/>

4. add serialID by updating the device with the help of below command: 
   $ virsh update-device <GuestName> guest-device.xml

Actual results:
1. Step2 o/p is null.
2. Step4 o/p is as below.
error: Failed to update device from t.xml
error: unsupported configuration: disk bus 'virtio' cannot be updated.

Expected results:
All virtio-blk devices should have ID_SERIAL.

Additional info:
Comment 2 Sibiao Luo 2013-01-21 01:11:55 EST
Hi all,

   Qemu-kvm did not support serial property for virtio_blk device before qemu-kvm-, you could check it by '/usr/libexec/qemu-kvm -device virtio-blk-pci,?'.
But it support later than qemu-kvm- BTW, there are two ways to specify the serial number for virtio_blk device, e.g: -drive serial=xxxxx,.... and ....-device virtio-blk-pci serial=xxxxx.
note: the serial ws limited to 20 charachters.
and we can check serial number in guest.
- Linux guest.
# cat /sys/block/vdX/serial
- Windows guest.
] hddsn.exe YYY    ---->   YYY is the disk you want to check.

Best Regards.
Comment 3 Ademar Reis 2013-01-22 08:56:01 EST
The feature was introduced by 0458d1ca16af0a6903e3409634bcd3cb5d445ca6, necessary for Bug 877836 (VERIFIED) and backported by Stefan. It'll be part of RHEL6.4.

Reassigning, marking it TestOnly and status:ON_QA.
Comment 4 Sibiao Luo 2013-01-22 21:16:38 EST
Hi all,
   Base on comment #2 and comment #3, disk serial numbers are supported later than qemu-kvm-, it'll be part of RHEL6.4, and i also tried latest qemu-kvm-, it works well. Close this issue as duplicated to bug 877836, free to correct me if any mistake.

Best Regards.

*** This bug has been marked as a duplicate of bug 877836 ***

Note You need to log in before you can comment on or make changes to this bug.