Bug 894211 - fail to works with the serial property for virtio scsi devices(scsi-hd,scsi-disk)
fail to works with the serial property for virtio scsi devices(scsi-hd,scsi-d...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Virtualization Maintenance
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-10 22:02 EST by Sibiao Luo
Modified: 2013-01-11 08:48 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 894210
Environment:
Last Closed: 2013-01-11 08:48:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 Sibiao Luo 2013-01-10 22:04:40 EST
host info:
kernel-3.6.0-0.29.el7.x86_64
qemu-kvm-1.3.0-3.el7.x86_64
seabios-1.7.2-0.2.gita810e4e7.el7.x86_64
guest info:
kernel-3.6.0-0.29.el7.x86_64
Comment 3 Sibiao Luo 2013-01-11 03:49:26 EST
(In reply to comment #2)
>
> SCSI disks do not have /sys/class/block/<dev>/serial attributes.  I believe
> this is standard Linux behavior - at least I can't find the serial attribute
> code in drivers/scsi/.
> 
> Please check:
> $ ls /dev/disk/by-id
> 
> You will see the disk serial is listed.
> 
> Alternatively, you can use:
> 
> $ scsi_id --whitelist /dev/<dev>
> 0QEMU    QEMU HARDDISK    <serial>

ok, thanks for your reminds. i mistake between /sys/class/block/<dev>/serial and /dev/disk/by-id. 
the scsi-block has no such serial property, so i think the qemu-kvm should also disable the serial property for the virtio scsi devices(scsi-hd,scsi-disk), otherwise it will confuse users.
Comment 4 Paolo Bonzini 2013-01-11 08:48:29 EST
> should disable the serial property for the virtio scsi devices(scsi-hd,scsi-
> disk), otherwise it will confuse users.

It works with upstream:

$ x86-64-softmmu/qemu-system-x86_64 --enable-kvm \
  -drive file=$HOME/test.img,id=hd,if=none -device virtio-scsi-pci \
  -device scsi-disk,serial=foo,drive=hd -m 256
...
# scsi_id --whitelisted /dev/sda
0QEMU    QEMU HARDDISK   foo

$ x86-64-softmmu/qemu-system-x86_64 --enable-kvm \
  -drive file=$HOME/test.img,id=hd,if=none,serial=foo -device virtio-scsi-pci \
  -device scsi-disk,drive=hd -m 256
...
# scsi_id --whitelisted /dev/sda
0QEMU    QEMU HARDDISK   foo


Same with scsi-hd.

scsi-block has no serial property because it uses the physical drive's serial number.

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