mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Added graceful shutdown support to QEMU/KVM (patch from Guido Guenther)
This commit is contained in:
parent
8796a9ff74
commit
78f2cd3d2d
1
AUTHORS
1
AUTHORS
@ -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....]
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user