Bug 1038944 - virsh domxml-from-native can not parse the virtio block device correctly if '-device virtio-blk-pci' specified
Summary: virsh domxml-from-native can not parse the virtio block device correctly if '...
Keywords:
Status: CLOSED DUPLICATE of bug 844845
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-06 08:29 UTC by caobbu
Modified: 2016-04-21 22:09 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-21 22:09:12 UTC
Embargoed:


Attachments (Terms of Use)

Description caobbu 2013-12-06 08:29:49 UTC
Description of problem:
virsh command 'domxml-from-native qemu-argv' can not parse the virtio block device correctly.

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

How reproducible:

cat /tmp/guest.args
/usr/local/bin/qemu-system-x86_64 -machine accel=kvm -name test -machine pc-0.15,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -nographic -no-user-config -nodefaults  -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/ovirt-storage/rhel6.img,if=none,id=drive-virtio-disk0,format=raw,index=0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6

virsh domxml-from-native qemu-argv /tmp/guest.args
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>test</name>
  <uuid>0a0baaf5-2a21-404c-99c4-378b3cf61da7</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.15'>hvm</type>
  </os>
  <features>
    <acpi/>
    <pae/>
  </features>
  <cpu>
    <topology sockets='2' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/ovirt-storage/rhel6.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'/>
    <controller type='usb' index='0'/>
    <controller type='pci' index='0' model='pci-root'/>
    <memballoon model='virtio'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-realtime'/>
    <qemu:arg value='mlock=off'/>
    <qemu:arg value='-no-user-config'/>
    <qemu:arg value='-nodefaults'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6'/>
  </qemu:commandline>
</domain>


cat /tmp/guest.args.1
/usr/bin/qemu-kvm -machine pc-0.14,accel=kvm  -m 1024 -smp 1,sockets=1,cores=1,threads=1 -drive file=/ovirt-storage/rhel6.img,if=virtio,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1

/usr/bin/qemu-kvm -machine pc-0.14,accel=kvm  -m 1024 -smp 1,sockets=1,cores=1,threads=1 -drive file=/ovirt-storage/rhel6.img,if=virtio,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
qemu-kvm: -drive file=/ovirt-storage/rhel6.img,if=virtio,id=drive-virtio-disk0,format=qcow2: Property 'virtio-blk-pci.drive' can't take value 'drive-virtio-disk0', it's in use

QEMU report error.

But, domxml-from-native work normally:

virsh domxml-from-native qemu-argv /tmp/guest.args.1
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>unnamed</name>
  <uuid>f752995a-4946-4beb-a9f1-951d055a8884</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
  </os>
  <features>
    <acpi/>
    <pae/>
  </features>
  <cpu>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/ovirt-storage/rhel6.img'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <controller type='usb' index='0'/>
    <controller type='pci' index='0' model='pci-root'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='sdl'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
    </video>
    <memballoon model='virtio'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1'/>
  </qemu:commandline>
</domain>


Actual results:
For /tmp/guest.args, the bus of the disk parsed as IDE.
For /tmp/guest.args.1, it parse the disk as virtio block.

Expected results:
For /tmp/guest.args, the bus of the disk should be parsed as a virtio disk.
For /tmp/guest.args.1, it should report error.

Comment 1 Jiri Denemark 2013-12-18 09:54:33 UTC
Well, this is filed against libvirt upstream, where it makes little sense to mark bugs as urgent. If you want to have the bug fixed early, participating in libvirt's development mailing list is the best way to go. And given what the nature of the bug is, the best option would be to actually try to fix the bug yourself and send the patch to the mailing list since domxml-from-native is not the most important part of libvirt API and thus unlikely to get enough attention to be fixed urgently.

Comment 2 Cole Robinson 2016-04-21 22:09:12 UTC

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


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