aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2011-10-05 18:31:55 +0100
committerMichal Privoznik <mprivozn@redhat.com>2012-01-24 12:19:51 +0100
commit0b7ddf9e7788958f0ced0de03572af25754324c8 (patch)
tree3795ace282753d5a4fd1a11cf12ceec11b438dcc /src/vbox/vbox_tmpl.c
parentQEMU guest agent support (diff)
downloadlibvirt-0b7ddf9e7788958f0ced0de03572af25754324c8.tar.gz
libvirt-0b7ddf9e7788958f0ced0de03572af25754324c8.tar.bz2
libvirt-0b7ddf9e7788958f0ced0de03572af25754324c8.zip
Add new virDomainShutdownFlags API
Add a new API virDomainShutdownFlags and define: VIR_DOMAIN_SHUTDOWN_DEFAULT = 0, VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0), VIR_DOMAIN_SHUTDOWN_GUEST_AGENT = (1 << 1), Also define some flags for the reboot API VIR_DOMAIN_REBOOT_DEFAULT = 0, VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0), VIR_DOMAIN_REBOOT_GUEST_AGENT = (1 << 1), Although these two APIs currently have the same flags, using separate enums allows them to expand separately in the future. Add stub impls of the new API for all existing drivers
Diffstat (limited to 'src/vbox/vbox_tmpl.c')
-rw-r--r--src/vbox/vbox_tmpl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 22712d578..d72043274 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -1606,7 +1606,8 @@ cleanup:
return ret;
}
-static int vboxDomainShutdown(virDomainPtr dom) {
+static int vboxDomainShutdownFlags(virDomainPtr dom,
+ unsigned int flags) {
VBOX_OBJECT_CHECK(dom->conn, int, -1);
IMachine *machine = NULL;
vboxIID iid = VBOX_IID_INITIALIZER;
@@ -1615,6 +1616,8 @@ static int vboxDomainShutdown(virDomainPtr dom) {
PRBool isAccessible = PR_FALSE;
nsresult rc;
+ virCheckFlags(0, -1);
+
vboxIIDFromUUID(&iid, dom->uuid);
rc = VBOX_OBJECT_GET_MACHINE(iid.value, &machine);
if (NS_FAILED(rc)) {
@@ -1656,6 +1659,11 @@ cleanup:
return ret;
}
+static int vboxDomainShutdown(virDomainPtr dom) {
+ return vboxDomainShutdownFlags(dom, 0);
+}
+
+
static int vboxDomainReboot(virDomainPtr dom, unsigned int flags)
{
VBOX_OBJECT_CHECK(dom->conn, int, -1);
@@ -9112,6 +9120,7 @@ virDriver NAME(Driver) = {
.domainSuspend = vboxDomainSuspend, /* 0.6.3 */
.domainResume = vboxDomainResume, /* 0.6.3 */
.domainShutdown = vboxDomainShutdown, /* 0.6.3 */
+ .domainShutdownFlags = vboxDomainShutdownFlags, /* 0.9.10 */
.domainReboot = vboxDomainReboot, /* 0.6.3 */
.domainDestroy = vboxDomainDestroy, /* 0.6.3 */
.domainDestroyFlags = vboxDomainDestroyFlags, /* 0.9.4 */