Bug 1150820

Summary: fail to specify wwn for virtual IDE CD-ROM
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvm-rhevAssignee: John Snow <jsnow>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: bsarathy, chayang, famz, flang, hhuang, jsnow, juzhang, kwolf, mazhang, michen, mkenneth, mrezanin, pbonzini, qzhang, rbalakri, virt-bugs, virt-maint, xigao
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.1.2-8.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1131316 Environment:
Last Closed: 2015-03-05 09:56:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1130475, 1131316    
Bug Blocks:    

Comment 1 Sibiao Luo 2014-10-09 03:14:56 UTC
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-183.el7.x86_64
qemu-kvm-rhev-2.1.2-1.el7.x86_64
guest info:
rhel7.0 GA

qemu-kvm command line:
e.g:...-drive file=/home/RHEL-7.0-Server-Released_x86_64.qcow2,if=none,id=drive-virtio-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=0,wwn=0x5000c50015ea71bb,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -drive file=/home/my-cdrom.iso,if=none,id=cd,format=raw,media=cdrom,readonly=on,cache=none,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=1,wwn=0x5000c50015ea71ad,drive=cd,id=cdrom

# ls -l /dev/disk/by-id/wwn*
lrwxrwxrwx. 1 root root  9 Oct  9 07:06 /dev/disk/by-id/wwn-0x5000c50015ea71bb -> ../../sda
lrwxrwxrwx. 1 root root 10 Oct  9 07:06 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Oct  9 07:06 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part2 -> ../../sda2
# ls -lh /dev/cdrom 
lrwxrwxrwx. 1 root root 3 Oct  9 07:06 /dev/cdrom -> sr0
# sg_inq -p 0x83 /dev/sda
VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 24
    designator_type: vendor specific [0x0],  code_set: ASCII
    associated with the addressed logical unit
      vendor specific: QM00001             
  Designation descriptor number 2, descriptor length: 72
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: ATA     
      vendor specific: QEMU HARDDISK                           QM00001             
  Designation descriptor number 3, descriptor length: 12
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 5, IEEE Company_id: 0xc50
      Vendor Specific Identifier: 0x15ea71bb
      [0x5000c50015ea71bb]
# sg_inq -p 0x83 /dev/sr0 
VPD INQUIRY: Device Identification page
invalid VPD response; probably a STANDARD INQUIRY response

Comment 2 Miroslav Rezanina 2014-11-13 09:06:22 UTC
Fix included in qemu-kvm-rhev-2.1.2-8.el7

Comment 4 langfang 2014-11-27 03:34:52 UTC
Reproduce this bug as follow version:
Host:
# uname -r
3.10.0-210.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-6.el7.x86_64

Guest:
3.10.0-210.el7.x86_64

Steps:
1.Boot guest with 
...-drive file=/root/RHEL-Server-7.0-64-copy.qcow2,if=none,id=drive-virtio-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=0,wwn=0x5000c50015ea71bb,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -drive file=/root/en_windows_xp_professional_x64.iso,if=none,id=cd,format=raw,media=cdrom,readonly=on,cache=none,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=1,wwn=0x5000c50015ea71ad,drive=cd,id=cdrom...

2.# ls -l /dev/disk/by-id/wwn-*
lrwxrwxrwx. 1 root root  9 Nov 27 06:25 /dev/disk/by-id/wwn-0x5000c50015ea71bb -> ../../sda
lrwxrwxrwx. 1 root root 10 Nov 27 06:25 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Nov 27 06:25 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part2 -> ../../sda2

Results:
 Fail to specify wwn for virtual IDE CD-ROM

Verify this bug as follow  version:
Host:
# uname -r
3.10.0-210.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-13.el7.x86_64

Guest:
3.10.0-210.el7.x86_64

Steps as same as reproduce

Results:
# sg_inq -p 0x83 /dev/sr0
VPD INQUIRY: Device Identification page
invalid VPD response; probably a STANDARD INQUIRY response

# ls -l /dev/disk/by-id/wwn*
lrwxrwxrwx. 1 root root  9 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71ad -> ../../sr0
lrwxrwxrwx. 1 root root  9 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb -> ../../sda
lrwxrwxrwx. 1 root root 10 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part2 -> ../../sda2


According to above test ,this bug has been fixed.

Comment 5 langfang 2014-11-27 05:16:24 UTC
Addtional test:

Version:
Host:
# uname -r
3.10.0-210.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-13.el7.x86_64

Guest:
3.10.0-210.el7.x86_64

Steps:
1.Boot guest with ide disk/ide-cdrom/scsi-cdrom ,all with wmn parameter
 
-drive file=/root/RHEL-Server-7.0-64-copy.qcow2,if=none,id=drive-virtio-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=0,wwn=0x5000c50015ea71bb,drive=drive-virtio-disk,id=virtio-disk,bootindex=1...-drive file=/root/en_windows_xp_professional_x64.iso,if=none,id=cd,format=raw,media=cdrom,readonly=on,cache=none,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=1,wwn=0x5000c50015ea71ad,drive=cd,id=cdrom...-drive file=/root/en_windows_xp_professional_x64.iso,if=none,media=cdrom,id=drive-cdrom-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi1 -device scsi-cd,wwn=0x5000c50015ea78aa,drive=drive-cdrom-disk,id=cdrom-disk,bus=scsi1.0


2.In guest
[root@localhost ~]# ll /dev/disk/by-id/wwn-*
lrwxrwxrwx. 1 root root  9 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71ad -> ../../sr1--->ide-cdrom
lrwxrwxrwx. 1 root root  9 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb -> ../../sda
lrwxrwxrwx. 1 root root 10 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea71bb-part2 -> ../../sda2
lrwxrwxrwx. 1 root root  9 Nov 27  2014 /dev/disk/by-id/wwn-0x5000c50015ea78aa -> ../../sr0-->scsi-cdrom

# sg_inq -p 0x83 /dev/sr1--->seem can't get the detail info for id-cdrom
VPD INQUIRY: Device Identification page
invalid VPD response; probably a STANDARD INQUIRY response

# sg_inq -p 0x83 /dev/sr0--->scsi-cdrom
VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 20
    designator_type: vendor specific [0x0],  code_set: ASCII
    associated with the addressed logical unit
      vendor specific: drive-cdrom-disk
  Designation descriptor number 2, descriptor length: 12
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 5, IEEE Company_id: 0xc50
      Vendor Specific Identifier: 0x15ea78aa
      [0x5000c50015ea78aa]

# sg_inq -p 0x83 /dev/sda--->ide disk
VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 24
    designator_type: vendor specific [0x0],  code_set: ASCII
    associated with the addressed logical unit
      vendor specific: QM00001             
  Designation descriptor number 2, descriptor length: 72
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: ATA     
      vendor specific: QEMU HARDDISK                           QM00001             
  Designation descriptor number 3, descriptor length: 12
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 5, IEEE Company_id: 0xc50
      Vendor Specific Identifier: 0x15ea71bb
      [0x5000c50015ea71bb]


Hi,John
   Is this the another problem ? Or triggered by this bug? If trigger by this bug,seem not fixed.

best regards
fang lang

Comment 6 John Snow 2014-12-01 15:57:54 UTC
I'll have to look at why sg_inq is failing; the bugs that this BZ was cloned from were fixed with a simple patch and I assumed the same patch would alleviate the problems here, but there might be something else causing that command to fail.

It seems that this patch did fix `ll /dev/disk/by-id/wwn-*` where it did not work previously. sg_inq *might* be a separate issue.

I'll research.

Comment 7 John Snow 2014-12-01 23:06:08 UTC
It looks as if Linux expects to find the wwn via the ATAPI IDENTIFY and/or ATA IDENTIFY commands, but the sg_inq tool expects to find it via the scsi/atapi inquiry command, in which we do not support for ATAPI entirely correctly.

It might be best to treat this as a separate bug ("IDE ATAPI devices do not respond to VPD inquiries") and fix this there.

Comment 8 langfang 2014-12-02 03:42:07 UTC
(In reply to John Snow from comment #7)
> It looks as if Linux expects to find the wwn via the ATAPI IDENTIFY and/or
> ATA IDENTIFY commands, but the sg_inq tool expects to find it via the
> scsi/atapi inquiry command, in which we do not support for ATAPI entirely
> correctly.
> 
> It might be best to treat this as a separate bug ("IDE ATAPI devices do not
> respond to VPD inquiries") and fix this there.


Hi,John
   thanks for your explanation, there is a new bug for track this issue:
   Bug 1169595 - IDE ATAPI devices do not respond to VPD inquiries


best regards
fang lang 


According to commen5,commnet6 and comment7, we can verify this bug.

Comment 11 errata-xmlrpc 2015-03-05 09:56:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0624.html