[libvirt PATCH v2 05/31] qemu_block: add async domain job support to qemuBlockPivot

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

 



This will allow to use it while having async domain job active which we
will use when deleting external snapshots.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c  | 4 +++-
 src/qemu/qemu_block.h  | 1 +
 src/qemu/qemu_driver.c | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index d2a56ba19c..6a68362708 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3402,6 +3402,7 @@ qemuBlockCommit(virDomainObj *vm,
 int
 qemuBlockPivot(virDomainObj *vm,
                qemuBlockJobData *job,
+               virDomainAsyncJob asyncJob,
                virDomainDiskDef *disk)
 {
     g_autoptr(qemuBlockStorageSourceChainData) chainattachdata = NULL;
@@ -3487,7 +3488,8 @@ qemuBlockPivot(virDomainObj *vm,
         break;
     }
 
-    qemuDomainObjEnterMonitor(vm);
+    if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
+        return -1;
 
     if (chainattachdata) {
         if ((rc = qemuBlockStorageSourceChainAttach(priv->mon, chainattachdata)) == 0) {
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index a76d9be711..3f2082f102 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -290,4 +290,5 @@ qemuBlockCommit(virDomainObj *vm,
 int
 qemuBlockPivot(virDomainObj *vm,
                qemuBlockJobData *job,
+               virDomainAsyncJob asyncJob,
                virDomainDiskDef *disk);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5ee6e2698d..acd67b1f5a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14163,7 +14163,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
         qemuBlockJobSyncBegin(job);
 
     if (pivot) {
-        if ((ret = qemuBlockPivot(vm, job, disk)) < 0)
+        if ((ret = qemuBlockPivot(vm, job, VIR_ASYNC_JOB_NONE, disk)) < 0)
             goto endjob;
     } else {
         qemuDomainObjEnterMonitor(vm);
-- 
2.39.0




[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