梁朝军
2021-Jun-04 11:22 UTC
How to hot plugin a new vhost-user-blk-pci device to running VM?
Hi Guys: Who can help me ? What does this issue mean? When I attach a network I hit this issue. libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'netdev_add': Invalid parameter type for 'vhost', expected: boolean Thanks!> ? 2021?5?24????7:08?Daniel P. Berrang? <berrange at redhat.com> ??? > > On Mon, May 24, 2021 at 01:04:44PM +0200, Michal Pr?vozn?k wrote: >> On 5/21/21 5:28 PM, ??? wrote: >>> Thanks all of you for your help. >>> One more question regarding vhost-user-blk-pci type device, how to identify a vhost-blk disk in QEUM VM ? for example, disk name looks like vda,vdb,..., but that some application in VM want to detect that a certain entry is really the device it is waiting for. Specific for windows , they always show as disk 0, 1, 2?.etc >>> Is there any way to identify those disk with each other in VM? >> >> In general no. Usually disks will be enumerated sequentially - thus the >> first disk on a sata/scsi/usb/.. bus will be sda, the second will be >> sdb, and so on. But libvirt can't guarantee it - the same way you can't >> guarantee how a disk is going to be called with real HW. > > You can set the 'serial' property in the disk in libvirt, and then match > that in the guest. For Linux guests that's used in /dev/disk/by-id > symlinks. > > Regards, > Daniel > -- > |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| > |: https://libvirt.org -o- https://fstop138.berrange.com :| > |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| >
Peter Krempa
2021-Jun-04 11:31 UTC
How to hot plugin a new vhost-user-blk-pci device to running VM?
On Fri, Jun 04, 2021 at 19:22:31 +0800, ??? wrote:> Hi Guys: > > Who can help me ? What does this issue mean? When I attach a network I hit this issue. > > libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'netdev_add': Invalid parameter type for 'vhost', expected: booleanYour qemu is too-new for libvirt. the 'netdev_add' command was converted to a strict description by QMP schema and libvirt wasn't ready for that. commit b6738ffc9f8be5a2a61236cd9bef7fd317982f01 Author: Peter Krempa <pkrempa at redhat.com> Date: Thu May 14 22:50:59 2020 +0200 qemu: command: Generate -netdev command line via JSON->cmdline conversion The 'netdev_add' command was recently formally described in qemu via the QMP schema. This means that it also requires the arguments to be properly formatted. Our current approach is to generate the command line and then use qemuMonitorJSONKeywordStringToJSON to get the JSON properties for the monitor. This will not work if we need to pass some fields as numbers or booleans. In this step we re-do internals of qemuBuildHostNetStr to format a JSON object which is converted back via virQEMUBuildNetdevCommandlineFromJSON to the equivalent command line. This will later allow fixing of the monitor code to use the JSON object directly rather than rely on the conversion. v6.3.0-139-gb6738ffc9f Thus you need at least libvirt 6.4.0 with that qemu.