[PATCH 3/8] qemu: blockjob: Add block job states for abort and pivot operations

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

 



When initiating a pivot or abort of a block job we need to track which
one was initiated. Currently it was done via data stashed in
virDomainDiskDef. Add possibility to track this also together with the
job itself.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 9 ++++++++-
 src/qemu/qemu_blockjob.h | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 292610d089..fe0114bf26 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -53,7 +53,9 @@ VIR_ENUM_IMPL(qemuBlockjobState,
               "ready",
               "new",
               "running",
-              "concluded");
+              "concluded",
+              "aborting",
+              "pivoting");

 VIR_ENUM_IMPL(qemuBlockjob,
               QEMU_BLOCKJOB_TYPE_LAST,
@@ -599,6 +601,8 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
     case QEMU_BLOCKJOB_STATE_NEW:
     case QEMU_BLOCKJOB_STATE_RUNNING:
     case QEMU_BLOCKJOB_STATE_CONCLUDED:
+    case QEMU_BLOCKJOB_STATE_ABORTING:
+    case QEMU_BLOCKJOB_STATE_PIVOTING:
     case QEMU_BLOCKJOB_STATE_LAST:
     default:
         break;
@@ -724,6 +728,9 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
     case QEMU_BLOCKJOB_STATE_NEW:
     case QEMU_BLOCKJOB_STATE_RUNNING:
     case QEMU_BLOCKJOB_STATE_LAST:
+    /* these are never processed as 'newstate' */
+    case QEMU_BLOCKJOB_STATE_ABORTING:
+    case QEMU_BLOCKJOB_STATE_PIVOTING:
     default:
         job->newstate = -1;
     }
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index d07ab75c8b..1f353116c8 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -40,6 +40,8 @@ typedef enum {
     QEMU_BLOCKJOB_STATE_RUNNING,
     QEMU_BLOCKJOB_STATE_CONCLUDED, /* job has finished, but it's unknown
                                       whether it has failed or not */
+    QEMU_BLOCKJOB_STATE_ABORTING,
+    QEMU_BLOCKJOB_STATE_PIVOTING,
     QEMU_BLOCKJOB_STATE_LAST
 } qemuBlockjobState;
 verify((int)QEMU_BLOCKJOB_STATE_NEW == VIR_DOMAIN_BLOCK_JOB_LAST);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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