[PATCH 1/7] virLXCProcessStop: Add 'cleanupFlags' parameter

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

 



Add possibility for the caller to set the flags for the call to
'virLXCProcessCleanup'.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/lxc/lxc_driver.c  |  2 +-
 src/lxc/lxc_process.c | 17 +++++++++--------
 src/lxc/lxc_process.h |  3 ++-
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 0d8cdcebfd..456d2fbae9 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1354,7 +1354,7 @@ lxcDomainDestroyFlags(virDomainPtr dom,
         goto endjob;

     priv = vm->privateData;
-    ret = virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
+    ret = virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED, 0);
     event = virDomainEventLifecycleNewFromObj(vm,
                                      VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 9dc7d9d0d8..587ba1d3c1 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -67,7 +67,7 @@ lxcProcessAutoDestroy(virDomainObj *dom,
     VIR_DEBUG("driver=%p dom=%s conn=%p", driver, dom->def->name, conn);

     VIR_DEBUG("Killing domain");
-    virLXCProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED);
+    virLXCProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED, 0);
     virDomainAuditStop(dom, "destroyed");
     event = virDomainEventLifecycleNewFromObj(dom,
                                      VIR_DOMAIN_EVENT_STOPPED,
@@ -108,7 +108,7 @@ virLXCProcessReboot(virLXCDriver *driver,
      * So temporarily hide the newDef and then reinstate it
      */
     savedDef = g_steal_pointer(&vm->newDef);
-    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
     vm->newDef = savedDef;
     if (virLXCProcessStart(conn, driver, vm,
                            0, NULL, autodestroy, reason) < 0) {
@@ -687,9 +687,9 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitor *mon,
     virObjectLock(vm);

     priv = vm->privateData;
-    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
     if (!priv->wantReboot) {
-        virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
+        virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
         if (!priv->doneStopEvent) {
             event = virDomainEventLifecycleNewFromObj(vm,
                                              VIR_DOMAIN_EVENT_STOPPED,
@@ -841,7 +841,8 @@ static virLXCMonitor *virLXCProcessConnectMonitor(virLXCDriver *driver,

 int virLXCProcessStop(virLXCDriver *driver,
                       virDomainObj *vm,
-                      virDomainShutoffReason reason)
+                      virDomainShutoffReason reason,
+                      unsigned int cleanupFlags)
 {
     int rc;
     virLXCDomainObjPrivate *priv;
@@ -899,7 +900,7 @@ int virLXCProcessStop(virLXCDriver *driver,
     }

  cleanup:
-    virLXCProcessCleanup(driver, vm, reason, 0);
+    virLXCProcessCleanup(driver, vm, reason, cleanupFlags);

     return 0;
 }
@@ -1535,7 +1536,7 @@ int virLXCProcessStart(virConnectPtr conn,
     if (rc != 0) {
         virErrorPreserveLast(&err);
         if (virDomainObjIsActive(vm)) {
-            virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED);
+            virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0);
         } else {
             /* virLXCProcessStop() is NOP if the container is not active.
              * If there was a failure whilst creating it, cleanup manually. */
@@ -1723,7 +1724,7 @@ virLXCProcessReconnectDomain(virDomainObj *vm,
     return ret;

  error:
-    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED);
+    virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0);
     virDomainAuditStop(vm, "failed");
     goto cleanup;
 }
diff --git a/src/lxc/lxc_process.h b/src/lxc/lxc_process.h
index 33ff334b74..1bce57809c 100644
--- a/src/lxc/lxc_process.h
+++ b/src/lxc/lxc_process.h
@@ -31,7 +31,8 @@ int virLXCProcessStart(virConnectPtr conn,
                        virDomainRunningReason reason);
 int virLXCProcessStop(virLXCDriver *driver,
                       virDomainObj *vm,
-                      virDomainShutoffReason reason);
+                      virDomainShutoffReason reason,
+                      unsigned int cleanupFlags);

 void virLXCProcessAutoDestroyRun(virLXCDriver *driver,
                                  virConnectPtr conn);
-- 
2.36.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