]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: remove duplicate check for pci subsystem type
authorOlaf Hering <olaf@aepfle.de>
Fri, 24 Apr 2015 16:01:02 +0000 (16:01 +0000)
committerJim Fehlig <jfehlig@suse.com>
Fri, 24 Apr 2015 21:22:20 +0000 (15:22 -0600)
Both attach and detach functions get called only if the type matches.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_driver.c

index d76efda9b700c1ce244342f9156f78b796f48e9c..f915f911193351e32747abbbaaf25359708c3f94 100644 (file)
@@ -2901,9 +2901,6 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr driver,
 
     libxl_device_pci_init(&pcidev);
 
-    if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
-        goto cleanup;
-
     if (virDomainHostdevFind(vm->def, hostdev, &found) >= 0) {
         virReportError(VIR_ERR_OPERATION_FAILED,
                        _("target pci device %.4x:%.2x:%.2x.%.1x already exists"),
@@ -3239,9 +3236,6 @@ libxlDomainDetachHostPCIDevice(libxlDriverPrivatePtr driver,
 
     libxl_device_pci_init(&pcidev);
 
-    if (subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
-        goto cleanup;
-
     idx = virDomainHostdevFind(vm->def, hostdev, &detach);
     if (idx < 0) {
         virReportError(VIR_ERR_OPERATION_FAILED,