mirror of https://gitee.com/openkylin/libvirt.git
libxl_driver.c: remove unneeded cleanup label
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e19f6cb7f2
commit
775f34c8bf
|
@ -4054,7 +4054,6 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
|
||||||
{
|
{
|
||||||
virDomainDiskDefPtr orig;
|
virDomainDiskDefPtr orig;
|
||||||
virDomainDiskDefPtr disk;
|
virDomainDiskDefPtr disk;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
switch (dev->type) {
|
switch (dev->type) {
|
||||||
case VIR_DOMAIN_DEVICE_DISK:
|
case VIR_DOMAIN_DEVICE_DISK:
|
||||||
|
@ -4062,31 +4061,28 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
|
||||||
if (!(orig = virDomainDiskByTarget(vmdef, disk->dst))) {
|
if (!(orig = virDomainDiskByTarget(vmdef, disk->dst))) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("target %s doesn't exist."), disk->dst);
|
_("target %s doesn't exist."), disk->dst);
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM)) {
|
if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("this disk doesn't support update"));
|
_("this disk doesn't support update"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDiskSetSource(orig, virDomainDiskGetSource(disk)) < 0)
|
if (virDomainDiskSetSource(orig, virDomainDiskGetSource(disk)) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
virDomainDiskSetType(orig, virDomainDiskGetType(disk));
|
virDomainDiskSetType(orig, virDomainDiskGetType(disk));
|
||||||
virDomainDiskSetFormat(orig, virDomainDiskGetFormat(disk));
|
virDomainDiskSetFormat(orig, virDomainDiskGetFormat(disk));
|
||||||
if (virDomainDiskSetDriver(orig, virDomainDiskGetDriver(disk)) < 0)
|
if (virDomainDiskSetDriver(orig, virDomainDiskGetDriver(disk)) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("persistent update of device is not supported"));
|
_("persistent update of device is not supported"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue