mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
destroy: Implement internal API for lxc driver
This commit is contained in:
parent
ba0219a752
commit
2dd3f025a0
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user