qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qdev: move legacy cli device creation after JSON syntax ones


From: Peter Krempa
Subject: Re: [PATCH] qdev: move legacy cli device creation after JSON syntax ones
Date: Wed, 23 Feb 2022 12:55:11 +0100
User-agent: Mutt/2.1.5 (2021-12-30)

On Wed, Feb 23, 2022 at 17:46:49 +0800, Zhenzhong Duan wrote:
> While libvirt does not support all the qemu parameters in standand
> xml syntax, such as hostfwd. We have to use <qemu:commandline> to
> passthrough the parameters. E.x:
> 
> <qemu:commandline>
>   <qemu:arg value='-netdev'/>
>     <qemu:arg value='user,id=mynet0,hostfwd=tcp::44483-:22'/>
>     <qemu:arg value='-device'/>
>   <qemu:arg 
> value='virtio-net-pci,netdev=mynet0,mac=00:16:3E:68:00:10,romfile='/>
> </qemu:commandline>
> 
> Then we got below error:
> 
> qemu-system-x86_64: -device 
> {"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}:
>  PCI: slot 1 function 0 not available for pcie-root-port, in use by 
> virtio-net-pci
> 
> Libvirt generates qemu "-device" in JSON syntax followed by the
> passthroughed "-device" in legacy syntax. But legacy syntax
> described devices are assigned BDF first, this leads to conflict
> with the pci devices in JSON syntax with fixed BDF.
> 
> Move legacy syntax described device creation after JSON syntax
> described ones so we can start that kind of VM successfully in
> libvirt.

As a libvirt developer I strongly suggest you post patches for your use
case to libvirt rather than trying to go behind our back with the
commandline passthrough.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]