[PATCH v2 4/9] qemuxml2argvtest: Drop needless PCI backend setting

Martin Kletzander mkletzan at redhat.com
Mon Apr 24 11:09:46 UTC 2023


On Mon, Apr 24, 2023 at 12:41:43PM +0200, Michal Privoznik wrote:
>The qemuxml2argvtest does a bit of 'fixups' to parsed
>virDomainDef just before generating the cmd line. For instance,
>it sets PCI backend for hostdevs (to VFIO). The reason for this
>is that we want to make the test host independent and thus
>letting the code chose backend at runtime might render different
>results on different machines. But this is not necessary, as
>virpcimock (that the test uses) already creates a fake, but
>stable environment (where /dev/vfio/vfio and IOMMU groups exist),
>thus qemuHostdevHostSupportsPassthroughVFIO() returns true,
>regardless of the actual host support.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>

>---
> tests/qemuxml2argvtest.c | 6 ------
> 1 file changed, 6 deletions(-)
>
>diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
>index 23e0c4054c..b65db3bbd9 100644
>--- a/tests/qemuxml2argvtest.c
>+++ b/tests/qemuxml2argvtest.c
>@@ -407,12 +407,6 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv,
>     for (i = 0; i < vm->def->nhostdevs; i++) {
>         virDomainHostdevDef *hostdev = vm->def->hostdevs[i];
>
>-        if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
>-            hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
>-            hostdev->source.subsys.u.pci.backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
>-            hostdev->source.subsys.u.pci.backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO;
>-        }
>-
>         if (virHostdevIsSCSIDevice(hostdev)) {
>             virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
>
>-- 
>2.39.2
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230424/d4680822/attachment.sig>


More information about the libvir-list mailing list