[libvirt] Parse commandline for -device option

Hong-Hua.Yin at freescale.com Hong-Hua.Yin at freescale.com
Wed Jun 4 09:07:12 UTC 2014


Hi Maintainers,

Currently libvirt could only parse commandline for several legacy devices.
For example,
-pcidevice:		qemuParseCommandLinePCI()
-usbdevice: 	qemuParseCommandLineUSB()

It also provides test cases for host device assignment.
    DO_TEST("hostdev-usb-address");
    DO_TEST("hostdev-pci-address");

But for other hostdev with -device option, it failed to convert into <hostdev> tag.

-device vfio-pci,host=06:12.5,id=hostdev0,bus=pci.0,addr=0x3
$ virsh domxml-from-native qemu-argv kvm.args >kvm.xml
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=06:12.5,id=hostdev0,bus=pci.0,addr=0x3'/>
  </qemu:commandline>

Expected XML file should like below:
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
      </source>
    </hostdev>

Maybe it is not very critical. 
Is it complicated to add support to -device option in function qemuParseCommandLine()?
Do you have any thought or plan about it?

Best Regards,
Olivia




More information about the libvir-list mailing list