]> xenbits.xensource.com Git - libvirt.git/commitdiff
destroy: Implement internal API for lxc driver
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Jul 2011 16:51:26 +0000 (18:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Jul 2011 18:41:27 +0000 (20:41 +0200)
src/lxc/lxc_driver.c

index 80378d37e220bb84701957833727fc812fd9d7f5..615d2c647bfbda4178c2b519e58eec158b5d57d4 100644 (file)
@@ -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 */