1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

destroy: Implement internal API for openvz driver

This commit is contained in:
Michal Privoznik 2011-07-21 09:49:02 +02:00
parent 2dd3f025a0
commit ab5eb92bbd

View File

@ -577,12 +577,16 @@ cleanup:
return ret;
}
static int openvzDomainShutdown(virDomainPtr dom) {
static int
openvzDomainShutdownFlags(virDomainPtr dom,
unsigned int flags) {
struct openvz_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
const char *prog[] = {VZCTL, "--quiet", "stop", PROGRAM_SENTINAL, NULL};
int ret = -1;
virCheckFlags(0, -1);
openvzDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
openvzDriverUnlock(driver);
@ -614,6 +618,12 @@ cleanup:
return ret;
}
static int
openvzDomainShutdown(virDomainPtr dom)
{
return openvzDomainShutdownFlags(dom, 0);
}
static int openvzDomainReboot(virDomainPtr dom,
unsigned int flags)
{
@ -1621,6 +1631,7 @@ static virDriver openvzDriver = {
.domainShutdown = openvzDomainShutdown, /* 0.3.1 */
.domainReboot = openvzDomainReboot, /* 0.3.1 */
.domainDestroy = openvzDomainShutdown, /* 0.3.1 */
.domainDestroyFlags = openvzDomainShutdownFlags, /* 0.9.4 */
.domainGetOSType = openvzGetOSType, /* 0.3.1 */
.domainGetInfo = openvzDomainGetInfo, /* 0.3.1 */
.domainGetState = openvzDomainGetState, /* 0.9.2 */