mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu_block: allow configuring autofinalize for block commit
External snapshots will use this to synchronize qemu block jobs. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
b308dc4b77
commit
11e30faf75
@ -3207,11 +3207,17 @@ qemuBlockExportAddNBD(virDomainObj *vm,
|
|||||||
* @top_parent: disk source that has @topSource as backing disk
|
* @top_parent: disk source that has @topSource as backing disk
|
||||||
* @bandwidth: bandwidth limit, flags determine the unit
|
* @bandwidth: bandwidth limit, flags determine the unit
|
||||||
* @asyncJob: qemu async job type
|
* @asyncJob: qemu async job type
|
||||||
|
* @autofinalize: virTristateBool controlling qemu block job finalization
|
||||||
* @flags: bitwise-OR of virDomainBlockCommitFlags
|
* @flags: bitwise-OR of virDomainBlockCommitFlags
|
||||||
*
|
*
|
||||||
* Starts a block commit job for @disk. If @asyncJob is different then
|
* Starts a block commit job for @disk. If @asyncJob is different then
|
||||||
* VIR_ASYNC_JOB_NONE the job will be started as synchronous.
|
* VIR_ASYNC_JOB_NONE the job will be started as synchronous.
|
||||||
*
|
*
|
||||||
|
* The @autofinalize argument controls if the qemu block job will be automatically
|
||||||
|
* finalized. This is used when deleting external snapshots where we need to
|
||||||
|
* disable automatic finalization for some use-case. The default value passed
|
||||||
|
* to this argument should be VIR_TRISTATE_BOOL_YES.
|
||||||
|
*
|
||||||
* Returns -1 on error, 0 on success.
|
* Returns -1 on error, 0 on success.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
@ -3222,6 +3228,7 @@ qemuBlockCommit(virDomainObj *vm,
|
|||||||
virStorageSource *top_parent,
|
virStorageSource *top_parent,
|
||||||
unsigned long bandwidth,
|
unsigned long bandwidth,
|
||||||
virDomainAsyncJob asyncJob,
|
virDomainAsyncJob asyncJob,
|
||||||
|
virTristateBool autofinalize,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
@ -3365,7 +3372,7 @@ qemuBlockCommit(virDomainObj *vm,
|
|||||||
topSource->nodeformat,
|
topSource->nodeformat,
|
||||||
baseSource->nodeformat,
|
baseSource->nodeformat,
|
||||||
backingPath, bandwidth,
|
backingPath, bandwidth,
|
||||||
VIR_TRISTATE_BOOL_YES);
|
autofinalize);
|
||||||
|
|
||||||
qemuDomainObjExitMonitor(vm);
|
qemuDomainObjExitMonitor(vm);
|
||||||
|
|
||||||
|
@ -285,6 +285,7 @@ qemuBlockCommit(virDomainObj *vm,
|
|||||||
virStorageSource *top_parent,
|
virStorageSource *top_parent,
|
||||||
unsigned long bandwidth,
|
unsigned long bandwidth,
|
||||||
virDomainAsyncJob asyncJob,
|
virDomainAsyncJob asyncJob,
|
||||||
|
virTristateBool autofinalize,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -15026,7 +15026,8 @@ qemuDomainBlockCommit(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
ret = qemuBlockCommit(vm, disk, baseSource, topSource, top_parent,
|
ret = qemuBlockCommit(vm, disk, baseSource, topSource, top_parent,
|
||||||
bandwidth, VIR_ASYNC_JOB_NONE, flags);
|
bandwidth, VIR_ASYNC_JOB_NONE, VIR_TRISTATE_BOOL_YES,
|
||||||
|
flags);
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
virDomainObjEndJob(vm);
|
virDomainObjEndJob(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user