[libvirt PATCH v2 14/15] tests: mock virPCIDevice(BindTo|UnbindFrom)Stub with nop functions

2023-11-05 Thread Laine Stump
Only in qemuhotplug test, in order to not fail when running the test on macOS. This is a temporary measure until I decice how best to make a mock environment that allows virPCIDeviceFindBestVariant() to succeed on non-Linux platforms (which is a bit nonsensical, since none of that code will ever r

[libvirt PATCH v2 13/15] util: new function virStringSkipToSpace()

2023-11-05 Thread Laine Stump
Add a surprisingly missing simple function to the arsenal. Signed-off-by: Laine Stump --- src/libvirt_private.syms | 1 + src/util/virstring.c | 17 + src/util/virstring.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_priv

[libvirt PATCH v2 01/15] util: properly deal with module vs. driver when binding device to driver

2023-11-05 Thread Laine Stump
Historically libvirt has treated the concept of "loadable kernel module" and "device driver" as being effectively the same (at least in the case of the vfio-pci driver used for VFIO device assignment). The code assumed that a module named "vfio-pci" implemented a driver named "vfio-pci". In realit

[libvirt PATCH v2 04/15] conf: normalize hostdev parsing to simplify adding new attr

2023-11-05 Thread Laine Stump
The hostdev version of the subelement appears in four places: * The domain XML in the and elements (that's 2) * The network XML inside when the network is a pool of SRIOV VFs * the XML, which is used to communicate between the hypervisor driver and network driver. In order to m

[libvirt PATCH v2 08/15] conf: use new common parser/formatter for hostdev driver in network XML

2023-11-05 Thread Laine Stump
Now if a new attribute is added to , we only need to update the formatting/parsing in one place. Signed-off-by: Laine Stump --- src/conf/network_conf.c | 24 src/conf/virnetworkportdef.c | 21 ++--- 2 files changed, 10 insertions(+), 35 deletions(-)

[libvirt PATCH v2 07/15] conf: split out hostdev parse/format to their own functions

2023-11-05 Thread Laine Stump
This is done so that we can re-use the same parser/formatter for and Signed-off-by: Laine Stump --- src/conf/device_conf.c | 41 + src/conf/device_conf.h | 7 +++ src/conf/domain_conf.c | 28 +--- 3 files changed, 53 insertio

[libvirt PATCH v2 02/15] schema: consolidate RNG for all hostdev elements

2023-11-05 Thread Laine Stump
The exact same element can appear in and , and nearly identical in and (these latter two don't include "xen" as a possible driver, but that's coincidental - there's no reason Xen couldn't also use the VF pools in virtual networks, it just doesn't). This patch modifies all 4 to use the same so

[libvirt PATCH v2 05/15] conf: put hostdev PCI backend into a struct

2023-11-05 Thread Laine Stump
The new struct is virDeviceHostdevPCIDriverInfo, and the "backend" enum in the hostdevDef will be replaced with a virDeviceHostdevPCIDriverInfo named "driver'. Since the enum value in this new struct is called "type", it means that all references to "backend" will become "driver.type". This will a

[libvirt PATCH v2 00/15] Support for VFIO variant drivers, Part 2

2023-11-05 Thread Laine Stump
(Thisis "V2 of Part 2". "V1 of Part 2" is here: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/5GF4N5D2HR37HIST3QZ6GXZ6CLIEWOVN/#5GF4N5D2HR37HIST3QZ6GXZ6CLIEWOVN ) Part 1 (which simply made it possible to use virsh nodedev-detach to bind a device to a manually-specified va