virDomainHostdevDefPtr hostdev)
{
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
- libxl_device_pci pcidev;
+ libxl_device_pci pcidev;
virDomainHostdevDefPtr found;
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci;
int ret = -1;
+ libxl_device_pci_init(&pcidev);
+
if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
goto cleanup;
cleanup:
virObjectUnref(cfg);
+ libxl_device_pci_dispose(&pcidev);
return ret;
}
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
int ret = -1;
+ libxl_device_pci_init(&pcidev);
+
if (subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
goto cleanup;
}
- libxl_device_pci_init(&pcidev);
-
if (libxlMakePCI(detach, &pcidev) < 0)
goto error;
goto error;
}
- libxl_device_pci_dispose(&pcidev);
virDomainHostdevRemove(vm->def, idx);
cleanup:
virObjectUnref(cfg);
+ libxl_device_pci_dispose(&pcidev);
return ret;
}