---
src/qemu/qemu_hotplug.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0f9cfd1..b0e1e4d 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3881,8 +3881,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
}
}
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
- !detach->info.alias) {
+ if (!detach->info.alias) {
if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
goto cleanup;
}
@@ -3902,21 +3901,11 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
qemuDomainObjEnterMonitor(driver, vm);
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
- if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- goto cleanup;
- virDomainAuditNet(vm, detach, NULL, "detach", false);
- goto cleanup;
- }
- } else {
- if (qemuMonitorRemovePCIDevice(priv->mon,
- &detach->info.addr.pci) < 0) {
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- goto cleanup;
- virDomainAuditNet(vm, detach, NULL, "detach", false);
+ if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- }
+ virDomainAuditNet(vm, detach, NULL, "detach", false);
+ goto cleanup;
}
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
--
2.8.1