[PATCH v2 RFC 4/4] qemu: remove the rest of nested job parts

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

 



It is not clear whether nested job could be saved in status file or not
so it stays in job types enum.
---
 src/qemu/qemu_domain.c  | 28 +---------------------------
 src/qemu/qemu_domain.h  |  6 +-----
 src/qemu/qemu_process.c |  2 +-
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5aaa97a..20580c6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -87,7 +87,7 @@ VIR_ENUM_IMPL(qemuDomainJob, QEMU_JOB_LAST,
               "abort",
               "migration operation",
               "none",   /* async job is never stored in job.active */
-              "async nested",
+              "async nested", /* keep for backward compatibility */
 );
 
 VIR_ENUM_IMPL(qemuDomainAsyncJob, QEMU_ASYNC_JOB_LAST,
@@ -3600,8 +3600,6 @@ qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
 {
     qemuDomainObjPrivatePtr priv = obj->privateData;
 
-    if (priv->job.active == QEMU_JOB_ASYNC_NESTED)
-        qemuDomainObjResetJob(priv);
     qemuDomainObjResetAsyncJob(priv);
     qemuDomainObjSaveJob(driver, obj);
 }
@@ -3825,30 +3823,6 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
     return 0;
 }
 
-int
-qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver,
-                            virDomainObjPtr obj,
-                            qemuDomainAsyncJob asyncJob)
-{
-    qemuDomainObjPrivatePtr priv = obj->privateData;
-
-    if (asyncJob != priv->job.asyncJob) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unexpected async job %d"), asyncJob);
-        return -1;
-    }
-
-    if (priv->job.asyncOwner != virThreadSelfID()) {
-        VIR_WARN("This thread doesn't seem to be the async job owner: %llu",
-                 priv->job.asyncOwner);
-    }
-
-    return qemuDomainObjBeginJobInternal(driver, obj,
-                                         QEMU_JOB_ASYNC_NESTED,
-                                         QEMU_ASYNC_JOB_NONE);
-}
-
-
 /*
  * obj must be locked and have a reference before calling
  *
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 39b3aed..062ad1d 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -76,7 +76,7 @@ typedef enum {
 
     /* The following two items must always be the last items before JOB_LAST */
     QEMU_JOB_ASYNC,         /* Asynchronous job */
-    QEMU_JOB_ASYNC_NESTED,  /* Normal job within an async job */
+    QEMU_JOB_PLACEHOLDER_1, /* Have to keep for backward compatibility */
 
     QEMU_JOB_LAST
 } qemuDomainJob;
@@ -439,10 +439,6 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
                                qemuDomainAsyncJob asyncJob,
                                virDomainJobOperation operation)
     ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver,
-                                virDomainObjPtr obj,
-                                qemuDomainAsyncJob asyncJob)
-    ATTRIBUTE_RETURN_CHECK;
 
 void qemuDomainObjEndJob(virQEMUDriverPtr driver,
                          virDomainObjPtr obj);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d9f4af7..a99a467 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3177,7 +3177,7 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver,
     case QEMU_JOB_MIGRATION_OP:
     case QEMU_JOB_ABORT:
     case QEMU_JOB_ASYNC:
-    case QEMU_JOB_ASYNC_NESTED:
+    case QEMU_JOB_PLACEHOLDER_1:
         /* async job was already handled above */
     case QEMU_JOB_NONE:
     case QEMU_JOB_LAST:
-- 
1.8.3.1

--
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