Added graceful shutdown support to QEMU/KVM (patch from Guido Guenther)

This commit is contained in:
Daniel P. Berrange 2008-01-09 16:05:21 +00:00
parent 8796a9ff74
commit 78f2cd3d2d
3 changed files with 28 additions and 1 deletions

View File

@ -38,6 +38,7 @@ Patches have also been contributed by:
Shuveb Hussain <shuveb@binarykarma.com>
Jim Paris <jim@jtan.com>
Chris Lalancette <clalance@redhat.com>
Guido Guenther <agx@sigxcpu.org>
[....send patches to get your name here....]

View File

@ -1,3 +1,8 @@
Wed Jan 9 10:55:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_driver.c: Wire up to system_shutdown command for
graceful ACPI triggered shutdown process (Guido Guenther)
Tue Jan 8 12:48:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/util.c: cast off_t to int in debug output to avoid warning

View File

@ -1849,6 +1849,27 @@ static int qemudDomainResume(virDomainPtr dom) {
}
static int qemudDomainShutdown(virDomainPtr dom) {
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
char* info;
if (!vm) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
"no domain with matching id %d", dom->id);
return -1;
}
if (qemudMonitorCommand(driver, vm, "system_powerdown", &info) < 0) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
"shutdown operation failed");
return -1;
}
return 0;
}
static int qemudDomainDestroy(virDomainPtr dom) {
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
@ -2855,7 +2876,7 @@ static virDriver qemuDriver = {
qemudDomainLookupByName, /* domainLookupByName */
qemudDomainSuspend, /* domainSuspend */
qemudDomainResume, /* domainResume */
qemudDomainDestroy, /* domainShutdown */
qemudDomainShutdown, /* domainShutdown */
NULL, /* domainReboot */
qemudDomainDestroy, /* domainDestroy */
qemudDomainGetOSType, /* domainGetOSType */