Wind River Support Network

HomeDefectsOVP6-36
Fixed

OVP6-36 : libvirt xml, can't pass qemu command to set device.virtio-disk0 parameters

Created: Jul 6, 2016    Updated: Feb 11, 2019
Resolved Date: Jul 24, 2016
Found In Version: 6.0.0.20
Fix Version: 6.0.0.31
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Userspace

Description

Customer want to use the virtio-blk data-plane feature with libvirt:
--------------------------------------
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source file='path/to/disk.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
...
  </devices>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.scsi=off'/>
  </qemu:commandline>
  <!-- config-wce=off is not needed in RHEL 6.4 -->
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.config-wce=off'/>
  </qemu:commandline>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.x-data-plane=on'/>
  </qemu:commandline>
<domain>
---------------------------------------------

As described in the web page:
http://blog.vmsplice.net/2013/03/new-in-qemu-14-high-performance-virtio.html

But I can't make it work, I always get the following error:
----------------------------------------
2016-07-07 04:06:41.726+0000: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -set device.virtio-disk0.scsi=off -set device.virtio-disk0.config-wce=off -set device.virtio-disk0.x-data-plane=on -name x86-64-kvm-guest -S -machine pc-i440fx-1.7,accel=kvm,usb=off -cpu Conroe -m 2048 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid db96a942-e384-43ad-a4a4-e3418a75062a -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/x86-64-kvm-guest.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=2016-07-07T04:06:41,driftfix=slew -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -drive if=none,id=drive-ide0-1-0,readonly=on,format=raw,serial= -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=2 -drive file=/media/sda1/gyang/x86-64-kvm-guest-vda.raw,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=22 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=96:58:76:21:25:34,bus=pci.0,addr=0x3,bootindex=3 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/x86-64-kvm-guest.default,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=default -chardev socket,id=charchannel1,path=/var/lib/libvirt/qemu/channel/target/x86-64-kvm-guest.org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 -vnc 0:0 -k en-us -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
Domain id=7 is tainted: custom-argv
kvm: -set device.virtio-disk0.scsi=off: there is no device "virtio-disk0" defined
2016-07-07 04:06:41.941+0000: shutting down
---------------------------------------------

As above log shows, the device "id=virtio-disk0" is defined.
As I know the "<qemu:commandline>" passed qemu parameters shoud be appended at the end of the qemu command line.
But it's at the begaining of the qemu command line, is this cause the failure?
Please help to check if it's supported to use the "qemu:commandline" to set the "device.virtio-disk0" in the libvirt xml file.

Steps to Reproduce

1. OVP 6 host project configured as following:
/opt/WRLX6/wrlinux-6/wrlinux/configure --enable-board=intel-x86-64 --enable-kernel=preempt-rt --enable-rootfs=ovp-kvm+installer-support --enable-addons=wr-ovp --enable-sdkimage-staticlibs=yes --with-template=feature/kvm,feature/benchmark,feature/debug,feature/gdb,feature/kdump,feature/kexec,feature/kernel-debug,feature/kernel-tune,feature/build_libc,feature/dpdk-vswitch,feature/lttng2 --enable-parallel-pkgbuilds=8 --enable-jobs=8 --enable-checkout-all-layers=yes --with-package=wrs-kvm-helper,qemu,libvirt,libvirt-libvirtd,libvirt-virsh,kernel-module-kvm,kernel-module-kvm-intel,kernel-module-kvm-amd,bridge-utils,inetutils,inetutils-rshd,inetutils-telnetd,inetutils-ftpd,ltp --enable-rm-oldimgs=yes --enable-internet-download=yes --enable-reconfig --with-rcpl-version=0020

2. In the OVP 6 host OS, use libvirt-xml-examples to generate example xml files. Use the x86-64-kvm-guest-local-raw.xml to start a VM with raw virtual disk, change the following lines in the xml file as below content:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
......
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source file='/media/sda1/gyang/x86-64-kvm-guest-vda.raw'/>
      <target dev='vda' bus='virtio'/>
      <serial>VDA</serial>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
......
  </devices>
    <qemu:commandline>
        <qemu:arg value='-set'/>
        <qemu:arg value='device.virtio-disk0.scsi=off'/>
    </qemu:commandline>
    <!-- config-wce=off is not needed in RHEL 6.4 -->
    <qemu:commandline>
        <qemu:arg value='-set'/>
        <qemu:arg value='device.virtio-disk0.config-wce=off'/>
    </qemu:commandline>
    <qemu:commandline>
        <qemu:arg value='-set'/>
        <qemu:arg value='device.virtio-disk0.x-data-plane=on'/>
    </qemu:commandline>
</domain>

3. virsh define x86-64-kvm-guest-local-raw-bak.xml
virsh start x86-64-kvm-guest

Then you will get the following error:
---------------------------
error: Failed to start domain x86-64-kvm-guest
error: internal error: process exited while connecting to monitor: kvm: -set device.virtio-disk0.scsi=off: there is no device "virtio-disk0" defined
---------------------

Other Downloads


Live chat
Online