--- src/qemu/qemu_driver.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 895e926..6f5712d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7655,13 +7655,12 @@ qemuDomainChangeDiskLive(virConnectPtr conn, { virDomainDiskDefPtr disk = dev->data.disk; virDomainDiskDefPtr orig_disk = NULL; - int ret = -1; if (virStorageTranslateDiskSourcePool(conn, disk) < 0) - goto cleanup; + return -1; if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto cleanup; + return -1; if (!(orig_disk = virDomainDiskFindByBusAndDst(vm->def, disk->bus, disk->dst))) { @@ -7669,26 +7668,26 @@ qemuDomainChangeDiskLive(virConnectPtr conn, _("No device with bus '%s' and target '%s'"), virDomainDiskBusTypeToString(disk->bus), disk->dst); - goto cleanup; + return -1; } switch ((virDomainDiskDevice) disk->device) { case VIR_DOMAIN_DISK_DEVICE_CDROM: case VIR_DOMAIN_DISK_DEVICE_FLOPPY: if (!qemuDomainDiskChangeSupported(disk, orig_disk)) - goto cleanup; + return -1; if (qemuDomainDiskSourceDiffers(disk, orig_disk)) { /* Add the new disk src into shared disk hash table */ if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0) - goto cleanup; + return -1; if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, dev->data.disk->src, force) < 0) { ignore_value(qemuRemoveSharedDisk(driver, dev->data.disk, vm->def->name)); - goto cleanup; + return -1; } dev->data.disk->src = NULL; @@ -7703,7 +7702,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk bus '%s' cannot be updated."), virDomainDiskBusTypeToString(disk->bus)); - goto cleanup; + return -1; break; case VIR_DOMAIN_DISK_DEVICE_LAST: @@ -7711,9 +7710,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn, break; } - ret = 0; - cleanup: - return ret; + return 0; } static int -- 2.8.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list