]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuxml2argvtest: Drop needless PCI backend setting
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 24 Apr 2023 07:51:46 +0000 (09:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 Apr 2023 10:36:30 +0000 (12:36 +0200)
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@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
tests/qemuxml2argvtest.c

index 270d6fa59e475f11bfdd41deed0d5eb95d3714ca..276b1ac68b0fbdb4c7af40a5282a92db3e58bd12 100644 (file)
@@ -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;