[libvirt RFC 04/24] qemu_block: add sync option to qemuBlockCommitImpl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will allow starting synchronous block commit job that will be
used by snapshot delete code.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 6 +++++-
 src/qemu/qemu_block.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 902ec7b2a5..bc46966d22 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3211,6 +3211,7 @@ qemuBlockCommitImpl(virDomainObj *vm,
                     virStorageSource *topSource,
                     virStorageSource *top_parent,
                     unsigned long bandwidth,
+                    bool sync,
                     unsigned int flags)
 {
     qemuDomainObjPrivate *priv = vm->privateData;
@@ -3338,6 +3339,9 @@ qemuBlockCommitImpl(virDomainObj *vm,
         !(backingPath = qemuBlockGetBackingStoreString(baseSource, false)))
         goto error;
 
+    if (sync)
+        qemuBlockJobSyncBegin(job);
+
     qemuDomainObjEnterMonitor(vm);
 
     rc = qemuMonitorBlockCommit(priv->mon,
@@ -3412,7 +3416,7 @@ qemuBlockCommit(virDomainObj *vm,
         return -1;
 
     return qemuBlockCommitImpl(vm, driver, disk, baseSource, topSource,
-                               top_parent, bandwidth, flags);
+                               top_parent, bandwidth, false, flags);
 }
 
 
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index 35f7718697..29b5ac9ea1 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -285,6 +285,7 @@ qemuBlockCommitImpl(virDomainObj *vm,
                     virStorageSource *topSource,
                     virStorageSource *top_parent,
                     unsigned long bandwidth,
+                    bool sync,
                     unsigned int flags);
 
 int
-- 
2.37.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux