[libvirt] [PATCH v2 06/13] destroy: Implement internal API for lxc driver

Michal Privoznik mprivozn at redhat.com
Thu Jul 21 16:08:37 UTC 2011


---
 src/lxc/lxc_driver.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index afac879..a2f56ed 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1934,20 +1934,25 @@ static void lxcDomainEventQueue(lxc_driver_t *driver,
 }
 
 /**
- * lxcDomainDestroy:
+ * lxcDomainDestroyFlags:
  * @dom: pointer to domain to destroy
+ * @flags: an OR'ed set of virDomainDestroyFlags
  *
  * Sends SIGKILL to container root process to terminate the container
  *
  * Returns 0 on success or -1 in case of error
  */
-static int lxcDomainDestroy(virDomainPtr dom)
+static int
+lxcDomainDestroyFlags(virDomainPtr dom,
+                      unsigned int flags)
 {
     lxc_driver_t *driver = dom->conn->privateData;
     virDomainObjPtr vm;
     virDomainEventPtr event = NULL;
     int ret = -1;
 
+    virCheckFlags(0, -1);
+
     lxcDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     if (!vm) {
@@ -1983,6 +1988,20 @@ cleanup:
     return ret;
 }
 
+/**
+ * lxcDomainDestroy:
+ * @dom: pointer to domain to destroy
+ *
+ * Sends SIGKILL to container root process to terminate the container
+ *
+ * Returns 0 on success or -1 in case of error
+ */
+static int
+lxcDomainDestroy(virDomainPtr dom)
+{
+    return lxcDomainDestroyFlags(dom, 0);
+}
+
 static int lxcCheckNetNsSupport(void)
 {
     const char *argv[] = {"ip", "link", "set", "lo", "netns", "-1", NULL};
@@ -2928,6 +2947,7 @@ static virDriver lxcDriver = {
     .domainSuspend = lxcDomainSuspend, /* 0.7.2 */
     .domainResume = lxcDomainResume, /* 0.7.2 */
     .domainDestroy = lxcDomainDestroy, /* 0.4.4 */
+    .domainDestroyFlags = lxcDomainDestroyFlags, /* 0.9.4 */
     .domainGetOSType = lxcGetOSType, /* 0.4.2 */
     .domainGetMaxMemory = lxcDomainGetMaxMemory, /* 0.7.2 */
     .domainSetMaxMemory = lxcDomainSetMaxMemory, /* 0.7.2 */
-- 
1.7.5.rc3




More information about the libvir-list mailing list