mirror of https://gitee.com/openkylin/libvirt.git
qemu: hotplug: Use more common 'cleanup' label in qemuDomainAttachDeviceDiskLive
This commit is contained in:
parent
fab859d11f
commit
43d9a14a21
|
@ -779,20 +779,20 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unsupported driver name '%s' for disk '%s'"),
|
_("unsupported driver name '%s' for disk '%s'"),
|
||||||
virDomainDiskGetDriver(disk), src);
|
virDomainDiskGetDriver(disk), src);
|
||||||
goto end;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
|
if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
|
||||||
goto end;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0)
|
if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0)
|
||||||
goto end;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuSetUnprivSGIO(dev) < 0)
|
if (qemuSetUnprivSGIO(dev) < 0)
|
||||||
goto end;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0)
|
if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0)
|
||||||
goto end;
|
goto cleanup;
|
||||||
|
|
||||||
switch ((virDomainDiskDevice) disk->device) {
|
switch ((virDomainDiskDevice) disk->device) {
|
||||||
case VIR_DOMAIN_DISK_DEVICE_CDROM:
|
case VIR_DOMAIN_DISK_DEVICE_CDROM:
|
||||||
|
@ -805,12 +805,12 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
|
||||||
"by libvirt"),
|
"by libvirt"),
|
||||||
virDomainDiskBusTypeToString(disk->bus),
|
virDomainDiskBusTypeToString(disk->bus),
|
||||||
disk->dst);
|
disk->dst);
|
||||||
goto end;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuDomainChangeEjectableMedia(driver, conn, vm, orig_disk,
|
if (qemuDomainChangeEjectableMedia(driver, conn, vm, orig_disk,
|
||||||
disk->src, false) < 0)
|
disk->src, false) < 0)
|
||||||
goto end;
|
goto cleanup;
|
||||||
|
|
||||||
disk->src = NULL;
|
disk->src = NULL;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -853,7 +853,7 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
cleanup:
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ignore_value(qemuRemoveSharedDevice(driver, dev, vm->def->name));
|
ignore_value(qemuRemoveSharedDevice(driver, dev, vm->def->name));
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue