mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu: migration_cookie: Remove pre-blockdev code paths
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d5857ea611
commit
1d53e96aad
@ -478,7 +478,6 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
|||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
g_autoptr(GHashTable) stats = virHashNew(g_free);
|
g_autoptr(GHashTable) stats = virHashNew(g_free);
|
||||||
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
|
|
||||||
size_t i;
|
size_t i;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -498,11 +497,11 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
|||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(vm, priv->job.asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(vm, priv->job.asyncJob) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (blockdev)
|
|
||||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
|
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
|
||||||
else
|
|
||||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats);
|
|
||||||
qemuDomainObjExitMonitor(vm);
|
qemuDomainObjExitMonitor(vm);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -510,14 +509,8 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
|||||||
virDomainDiskDef *disk = vm->def->disks[i];
|
virDomainDiskDef *disk = vm->def->disks[i];
|
||||||
qemuBlockStats *entry;
|
qemuBlockStats *entry;
|
||||||
|
|
||||||
if (blockdev) {
|
if (!(entry = virHashLookup(stats, disk->src->nodeformat)))
|
||||||
if (!(entry = virHashLookup(stats, disk->src->nodeformat)))
|
continue;
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
if (!disk->info.alias ||
|
|
||||||
!(entry = virHashLookup(stats, disk->info.alias)))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
mig->nbd->disks[mig->nbd->ndisks].target = g_strdup(disk->dst);
|
mig->nbd->disks[mig->nbd->ndisks].target = g_strdup(disk->dst);
|
||||||
mig->nbd->disks[mig->nbd->ndisks].capacity = entry->capacity;
|
mig->nbd->disks[mig->nbd->ndisks].capacity = entry->capacity;
|
||||||
|
Loading…
Reference in New Issue
Block a user