summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Hrdina <phrdina@redhat.com>2023-01-02 14:46:51 +0100
committerPavel Hrdina <phrdina@redhat.com>2023-01-09 13:32:45 +0100
commit11e30faf75f4b5160bb8840e6e643af9bc84faa8 (patch)
treeac981fbe34bf06f853b308811e6b9cb00f469b5e /src
parentb308dc4b7786fbc326856bb7d3d4b838efa6ad90 (diff)
downloadlibvirt-11e30faf75f4b5160bb8840e6e643af9bc84faa8.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/qemu/qemu_block.c9
-rw-r--r--src/qemu/qemu_block.h1
-rw-r--r--src/qemu/qemu_driver.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 99409a969b..da3a1e8557 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3207,11 +3207,17 @@ qemuBlockExportAddNBD(virDomainObj *vm,
* @top_parent: disk source that has @topSource as backing disk
* @bandwidth: bandwidth limit, flags determine the unit
* @asyncJob: qemu async job type
+ * @autofinalize: virTristateBool controlling qemu block job finalization
* @flags: bitwise-OR of virDomainBlockCommitFlags
*
* Starts a block commit job for @disk. If @asyncJob is different then
* 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.
*/
int
@@ -3222,6 +3228,7 @@ qemuBlockCommit(virDomainObj *vm,
virStorageSource *top_parent,
unsigned long bandwidth,
virDomainAsyncJob asyncJob,
+ virTristateBool autofinalize,
unsigned int flags)
{
qemuDomainObjPrivate *priv = vm->privateData;
@@ -3365,7 +3372,7 @@ qemuBlockCommit(virDomainObj *vm,
topSource->nodeformat,
baseSource->nodeformat,
backingPath, bandwidth,
- VIR_TRISTATE_BOOL_YES);
+ autofinalize);
qemuDomainObjExitMonitor(vm);
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index 3f2082f102..7b6aec2a7d 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -285,6 +285,7 @@ qemuBlockCommit(virDomainObj *vm,
virStorageSource *top_parent,
unsigned long bandwidth,
virDomainAsyncJob asyncJob,
+ virTristateBool autofinalize,
unsigned int flags);
int
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 970cc29eaf..c6bca8a24e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15026,7 +15026,8 @@ qemuDomainBlockCommit(virDomainPtr dom,
goto endjob;
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:
virDomainObjEndJob(vm);