[libvirt] Parse commandline for -device option

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

On 06/04/2014 03:07 AM, Hong-Hua.Yin@freescale.com wrote:
Hi Maintainers,
Currently libvirt could only parse commandline for several legacy devices. For example, -pcidevice: qemuParseCommandLinePCI() -usbdevice: qemuParseCommandLineUSB()
Yes, the domxml-from-native functionality is woefully under-maintained for qemu. Patches are welcome.
Is it complicated to add support to -device option in function qemuParseCommandLine()? Do you have any thought or plan about it?
You're welcome to give it a shot to find out how easy or hard it will be; it's just that few enough people are relying on it that no one has moved it to the top of their priority list to fix it. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Jun 04, 2014 at 10:27:32AM -0600, Eric Blake wrote:
On 06/04/2014 03:07 AM, Hong-Hua.Yin@freescale.com wrote:
Hi Maintainers,
Currently libvirt could only parse commandline for several legacy devices. For example, -pcidevice: qemuParseCommandLinePCI() -usbdevice: qemuParseCommandLineUSB()
Yes, the domxml-from-native functionality is woefully under-maintained for qemu. Patches are welcome.
Is it complicated to add support to -device option in function qemuParseCommandLine()? Do you have any thought or plan about it?
You're welcome to give it a shot to find out how easy or hard it will be; it's just that few enough people are relying on it that no one has moved it to the top of their priority list to fix it.
It probably isn't that hard - merely alot of tedious work - which is why it hasn't been done. If you do want to work on it, don't feel you need to implement everything - even just making a small start for a particular type of device (eg host PCI devicecs), would be useful and set a foundation for future work Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Hong-Hua.Yin@freescale.com