From ea4867bfe2c2990f62c3158b875f56dbf540f372 Mon Sep 17 00:00:00 2001
Message-Id: <ea4867bfe2c2990f62c3158b875f56dbf540f372@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 4 Feb 2020 15:08:07 +0100
Subject: [PATCH] qemuMigrationCookieAddNBD: Remove 'ret' variable and
'cleanup' label
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit d409411213152d204b85daf05468c4f7f17c1616)
https://bugzilla.redhat.com/show_bug.cgi?id=1793263
Message-Id: <1feef9fdcf0e2f1178e8136192d91a6558cc6149.1580824112.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/qemu/qemu_migration_cookie.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 968a9b589c..734d95f4f1 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -456,7 +456,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) stats = virHashNew(virHashValueFree);
size_t i;
- int ret = -1, rc;
+ int rc;
/* It is not a bug if there already is a NBD data */
qemuMigrationCookieNBDFree(mig->nbd);
@@ -473,10 +473,10 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
mig->nbd->ndisks = 0;
if (qemuDomainObjEnterMonitorAsync(driver, vm, priv->job.asyncJob) < 0)
- goto cleanup;
+ return -1;
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats, false);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
- goto cleanup;
+ return -1;
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i];
@@ -491,9 +491,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
mig->nbd->ndisks++;
}
- ret = 0;
- cleanup:
- return ret;
+ return 0;
}
--
2.25.0