1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

libxl: remove duplicate check for pci subsystem type

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>
This commit is contained in:
Olaf Hering 2015-04-24 16:01:02 +00:00 committed by Jim Fehlig
parent f54391b447
commit bb5fc7214e

View File

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