We can call it in one place as all per-device-type subcases use the same
code.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 8d0ee1c659..33c6feea3e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -986,15 +986,11 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
goto cleanup;
releaseUSB = true;
-
- ret = qemuDomainAttachDiskGeneric(driver, vm, disk);
break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
if (qemuDomainEnsureVirtioAddress(&releaseVirtio, vm, dev, disk->dst) <
0)
goto cleanup;
-
- ret = qemuDomainAttachDiskGeneric(driver, vm, disk);
break;
case VIR_DOMAIN_DISK_BUS_SCSI:
@@ -1023,8 +1019,6 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
if (!qemuDomainFindOrCreateSCSIDiskController(driver, vm, i))
goto cleanup;
}
-
- ret = qemuDomainAttachDiskGeneric(driver, vm, disk);
break;
case VIR_DOMAIN_DISK_BUS_IDE:
@@ -1043,6 +1037,8 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
virDomainDiskBusTypeToString(disk->bus));
}
+ ret = qemuDomainAttachDiskGeneric(driver, vm, disk);
+
cleanup:
if (ret < 0) {
ignore_value(qemuRemoveSharedDevice(driver, dev, vm->def->name));
--
2.31.1