Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1019539

Summary: obscure error message when an if=virtio disk is used also with -device
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, bsarathy, chayang, famz, hhuang, juzhang, michen, mkenneth, pbonzini, qzhang, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1019538 Environment:
Last Closed: 2014-07-14 01:59:25 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: 1019538    
Bug Blocks:    

Comment 1 Sibiao Luo 2013-10-16 02:49:05 UTC
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-23.el7.x86_64
qemu-kvm-1.5.3-9.el7.x86_64

# /usr/libexec/qemu-kvm -M pc -S -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -drive file=/home/win2012-64-virtio.qcow2,if=ide,id=drive-data-disk,format=qcow2,cache=none -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0 -k en-us -boot menu=on -spice disable-ticketing,port=5931 -monitor stdio
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0: Property 'scsi-hd.drive' can't take value 'drive-data-disk', it's in use

# /usr/libexec/qemu-kvm -M pc -S -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -drive file=/home/win2012-64-virtio.qcow2,if=virtio,id=drive-data-disk,format=qcow2,cache=none -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0 -k en-us -boot menu=on -spice disable-ticketing,port=5931 -monitor stdio
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) qemu-kvm: -drive file=/home/win2012-64-virtio.qcow2,if=virtio,id=drive-data-disk,format=qcow2,cache=none: Property 'virtio-blk-pci.drive' can't take value 'drive-data-disk', it's in use

# /usr/libexec/qemu-kvm -M pc -S -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -drive file=/home/win2012-64-virtio.qcow2,if=floppy,id=drive-data-disk,format=qcow2,cache=none -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0 -k en-us -boot menu=on -spice disable-ticketing,port=5931 -monitor stdio
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0: Property 'scsi-hd.drive' can't take value 'drive-data-disk', it's in use

# /usr/libexec/qemu-kvm -M pc -S -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -drive file=/home/win2012-64-virtio.qcow2,if=cdrom,id=drive-data-disk,format=qcow2,cache=none -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0 -k en-us -boot menu=on -spice disable-ticketing,port=5931 -monitor stdio
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
qemu-kvm: -drive file=/home/win2012-64-virtio.qcow2,if=cdrom,id=drive-data-disk,format=qcow2,cache=none: unsupported bus type 'cdrom'

Comment 2 Paolo Bonzini 2013-10-17 10:10:53 UTC
You have:

-drive file=/mnt/my-data-disk.qcow2,if=floppy,id=drive-data-disk,format=qcow2,cache=none -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0

So drive-data-disk is in use by both virtio-scsi and floppy.  So your second and third example have a perfectly fine error.

In the first example, the error ("Property 'virtio-blk-pci.drive' can't take value 'drive-data-disk', it's in use") refers to the virtio-blk-pci device that "if=virtio" creates implicitly.  It does not refer to the scsi-hd device.

-drive file=/mnt/my-data-disk.qcow2,if=virtio,id=drive-data-disk,format=qcow2,cache=none
-device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi0.0

But the error is only obscure, not wrong.

Comment 4 Ademar Reis 2014-05-28 17:47:15 UTC
Will this problem ever by hit through libvirt?

Comment 5 Sibiao Luo 2014-05-29 04:33:00 UTC
(In reply to Ademar Reis from comment #4)
> Will this problem ever by hit through libvirt?
The libvirt used if=none by default which i think it would not hit this issue at all, as I did not find where to specify if='virtio'/'ide'/'floppy'... in virsh XML configure file.

# cat test.xml | grep disk -A 4 
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/home/RHEL-7.0-20140505.1_Server_x86_64.raw'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <interface type='network'>
      <mac address='52:54:00:92:a5:29'/>
      <source network='default'/>
      <model type='rtl8139'/>

It generated the qemu-kvm command line as following:
...-drive file=/home/RHEL-7.0-20140505.1_Server_x86_64.raw,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1

Best Regards,
sluo

Comment 6 Fam Zheng 2014-05-29 05:30:14 UTC
Perhaps we should report in use by whom.

Comment 7 Fam Zheng 2014-07-14 01:59:25 UTC
Because if=virtio is legacy usage, and libvirt always uses if=none with -device, closing this as WONTFIX.