mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: backup: integrate with blockpull
Merge the bitmaps when finalizing a block pull job so that backups work properly afterwards. https://bugzilla.redhat.com/show_bug.cgi?id=1799010 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
3927880e9a
commit
7b2163c8bf
@ -936,6 +936,41 @@ qemuBlockJobClearConfigChain(virDomainObjPtr vm,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObjPtr vm,
|
||||
qemuBlockJobDataPtr job,
|
||||
qemuDomainAsyncJob asyncJob)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
g_autoptr(virHashTable) blockNamedNodeData = NULL;
|
||||
g_autoptr(virJSONValue) actions = NULL;
|
||||
|
||||
if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob)))
|
||||
return -1;
|
||||
|
||||
if (qemuBlockGetBitmapMergeActions(job->disk->src,
|
||||
job->data.pull.base,
|
||||
job->disk->src,
|
||||
NULL, NULL, NULL,
|
||||
&actions,
|
||||
blockNamedNodeData) < 0)
|
||||
return -1;
|
||||
|
||||
if (!actions)
|
||||
return 0;
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
|
||||
return -1;
|
||||
|
||||
qemuMonitorTransaction(priv->mon, &actions);
|
||||
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBlockJobProcessEventCompletedPull:
|
||||
* @driver: qemu driver object
|
||||
@ -976,6 +1011,8 @@ qemuBlockJobProcessEventCompletedPull(virQEMUDriverPtr driver,
|
||||
if (!cfgdisk)
|
||||
qemuBlockJobClearConfigChain(vm, job->disk);
|
||||
|
||||
qemuBlockJobProcessEventCompletedPullBitmaps(vm, job, asyncJob);
|
||||
|
||||
/* when pulling if 'base' is right below the top image we don't have to modify it */
|
||||
if (job->disk->src->backingStore == job->data.pull.base)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user