Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_migration_cookie.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index 0738ad430f..88c147e9fa 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -479,7 +479,6 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig, { qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) stats = virHashNew(g_free); - bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); size_t i; int rc; @@ -499,11 +498,11 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig, if (qemuDomainObjEnterMonitorAsync(driver, vm, priv->job.asyncJob) < 0) return -1; - if (blockdev) - rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats); - else - rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats); + + rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats); + qemuDomainObjExitMonitor(vm); + if (rc < 0) return -1; @@ -511,14 +510,8 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig, virDomainDiskDef *disk = vm->def->disks[i]; qemuBlockStats *entry; - if (blockdev) { - if (!(entry = virHashLookup(stats, disk->src->nodeformat))) - continue; - } else { - if (!disk->info.alias || - !(entry = virHashLookup(stats, disk->info.alias))) - continue; - } + if (!(entry = virHashLookup(stats, disk->src->nodeformat))) + continue; mig->nbd->disks[mig->nbd->ndisks].target = g_strdup(disk->dst); mig->nbd->disks[mig->nbd->ndisks].capacity = entry->capacity; -- 2.36.1