[PATCH 04/11] qemu: introduce QEMU_ASYNC_JOB_SNAPSHOT_DELETE

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

 



We are going to use this job for snapshot delete API. Currently snapshot
delete API uses QEMU_JOB_MODIFY.

Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy@xxxxxxxxxx>
---
 src/hypervisor/domain_job.c | 1 +
 src/hypervisor/domain_job.h | 1 +
 src/qemu/qemu_domainjob.c   | 2 ++
 src/qemu/qemu_driver.c      | 6 ++++++
 src/qemu/qemu_migration.c   | 2 ++
 src/qemu/qemu_process.c     | 3 +++
 6 files changed, 15 insertions(+)

diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c
index ff4e008cb5..ad71a77150 100644
--- a/src/hypervisor/domain_job.c
+++ b/src/hypervisor/domain_job.c
@@ -37,6 +37,7 @@ VIR_ENUM_IMPL(virDomainAsyncJob,
               "save",
               "dump",
               "snapshot",
+              "snapshot delete",
               "start",
               "backup",
 );
diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h
index db8b8b1390..cb24e3f743 100644
--- a/src/hypervisor/domain_job.h
+++ b/src/hypervisor/domain_job.h
@@ -63,6 +63,7 @@ typedef enum {
     VIR_ASYNC_JOB_SAVE,
     VIR_ASYNC_JOB_DUMP,
     VIR_ASYNC_JOB_SNAPSHOT,
+    VIR_ASYNC_JOB_SNAPSHOT_DELETE,
     VIR_ASYNC_JOB_START,
     VIR_ASYNC_JOB_BACKUP,
 
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 56a3f6cb19..89f721abc9 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -85,6 +85,7 @@ virDomainAsyncJobPhaseToString(virDomainAsyncJob job,
     case VIR_ASYNC_JOB_SAVE:
     case VIR_ASYNC_JOB_DUMP:
     case VIR_ASYNC_JOB_SNAPSHOT:
+    case VIR_ASYNC_JOB_SNAPSHOT_DELETE:
     case VIR_ASYNC_JOB_START:
     case VIR_ASYNC_JOB_NONE:
     case VIR_ASYNC_JOB_BACKUP:
@@ -111,6 +112,7 @@ virDomainAsyncJobPhaseFromString(virDomainAsyncJob job,
     case VIR_ASYNC_JOB_SAVE:
     case VIR_ASYNC_JOB_DUMP:
     case VIR_ASYNC_JOB_SNAPSHOT:
+    case VIR_ASYNC_JOB_SNAPSHOT_DELETE:
     case VIR_ASYNC_JOB_START:
     case VIR_ASYNC_JOB_NONE:
     case VIR_ASYNC_JOB_BACKUP:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 74bc2c7bf4..547cffa1bc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12741,6 +12741,12 @@ static int qemuDomainAbortJob(virDomainPtr dom)
         ret = 0;
         break;
 
+    case VIR_ASYNC_JOB_SNAPSHOT_DELETE:
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("snapshot deletion expected to be exclusive job"));
+        goto endjob;
+        break;
+
     case VIR_ASYNC_JOB_LAST:
     default:
         virReportEnumRangeError(virDomainAsyncJob, priv->job.asyncJob);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3e653543c6..cb4c0e544a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1717,6 +1717,8 @@ qemuMigrationJobName(virDomainObj *vm)
         return _("snapshot job");
     case VIR_ASYNC_JOB_START:
         return _("start job");
+    case VIR_ASYNC_JOB_SNAPSHOT_DELETE:
+        return _("snapshot delete job");
     case VIR_ASYNC_JOB_BACKUP:
         return _("backup job");
     case VIR_ASYNC_JOB_LAST:
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f110e4f3dd..9918423701 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3648,6 +3648,9 @@ qemuProcessRecoverJob(virQEMUDriver *driver,
         /* Already handled in VIR_DOMAIN_PAUSED_STARTING_UP check. */
         break;
 
+    case VIR_ASYNC_JOB_SNAPSHOT_DELETE:
+        break;
+
     case VIR_ASYNC_JOB_BACKUP:
         ignore_value(virTimeMillisNow(&now));
 
-- 
2.35.1




[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