Bug 1019539 - obscure error message when an if=virtio disk is used also with -device
obscure error message when an if=virtio disk is used also with -device
Status: CLOSED WONTFIX
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: Fam Zheng
Virtualization Bugs
:
Depends On: 1019538
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-15 22:47 EDT by Sibiao Luo
Modified: 2014-07-13 21:59 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1019538
Environment:
Last Closed: 2014-07-13 21:59:25 EDT
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-10-15 22:49:05 EDT
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 06:10:53 EDT
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 13:47:15 EDT
Will this problem ever by hit through libvirt?
Comment 5 Sibiao Luo 2014-05-29 00:33:00 EDT
(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 01:30:14 EDT
Perhaps we should report in use by whom.
Comment 7 Fam Zheng 2014-07-13 21:59:25 EDT
Because if=virtio is legacy usage, and libvirt always uses if=none with -device, closing this as WONTFIX.

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