---
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 acad666..2888164 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3382,8 +3382,7 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
}
}
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
- !detach->info.alias) {
+ if (!detach->info.alias) {
if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0)
goto cleanup;
}
@@ -3391,21 +3390,11 @@ qemuDomainDetachVirtioDiskDevice(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;
- virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
- goto cleanup;
- }
- } else {
- if (qemuMonitorRemovePCIDevice(priv->mon,
- &detach->info.addr.pci) < 0) {
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- goto cleanup;
- virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+ if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- }
+ virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+ goto cleanup;
}
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
--
2.8.1