From 775f34c8bf8451dc3ae4142139d985f4515e0480 Mon Sep 17 00:00:00 2001 From: Daniel Henrique Barboza Date: Mon, 21 Oct 2019 15:19:06 -0300 Subject: [PATCH] libxl_driver.c: remove unneeded cleanup label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Henrique Barboza Reviewed-by: Ján Tomko --- src/libxl/libxl_driver.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 47284a6b6c..277d99b2b0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -4054,7 +4054,6 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) { virDomainDiskDefPtr orig; virDomainDiskDefPtr disk; - int ret = -1; switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -4062,31 +4061,28 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) if (!(orig = virDomainDiskByTarget(vmdef, disk->dst))) { virReportError(VIR_ERR_INVALID_ARG, _("target %s doesn't exist."), disk->dst); - goto cleanup; + return -1; } if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("this disk doesn't support update")); - goto cleanup; + return -1; } if (virDomainDiskSetSource(orig, virDomainDiskGetSource(disk)) < 0) - goto cleanup; + return -1; virDomainDiskSetType(orig, virDomainDiskGetType(disk)); virDomainDiskSetFormat(orig, virDomainDiskGetFormat(disk)); if (virDomainDiskSetDriver(orig, virDomainDiskGetDriver(disk)) < 0) - goto cleanup; + return -1; break; default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("persistent update of device is not supported")); - goto cleanup; + return -1; } - ret = 0; - - cleanup: - return ret; + return 0; }