mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +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>
|
Shuveb Hussain <shuveb@binarykarma.com>
|
||||||
Jim Paris <jim@jtan.com>
|
Jim Paris <jim@jtan.com>
|
||||||
Chris Lalancette <clalance@redhat.com>
|
Chris Lalancette <clalance@redhat.com>
|
||||||
|
Guido Guenther <agx@sigxcpu.org>
|
||||||
|
|
||||||
[....send patches to get your name here....]
|
[....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>
|
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
|
* 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) {
|
static int qemudDomainDestroy(virDomainPtr dom) {
|
||||||
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
|
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
|
||||||
struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
|
struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
|
||||||
@ -2855,7 +2876,7 @@ static virDriver qemuDriver = {
|
|||||||
qemudDomainLookupByName, /* domainLookupByName */
|
qemudDomainLookupByName, /* domainLookupByName */
|
||||||
qemudDomainSuspend, /* domainSuspend */
|
qemudDomainSuspend, /* domainSuspend */
|
||||||
qemudDomainResume, /* domainResume */
|
qemudDomainResume, /* domainResume */
|
||||||
qemudDomainDestroy, /* domainShutdown */
|
qemudDomainShutdown, /* domainShutdown */
|
||||||
NULL, /* domainReboot */
|
NULL, /* domainReboot */
|
||||||
qemudDomainDestroy, /* domainDestroy */
|
qemudDomainDestroy, /* domainDestroy */
|
||||||
qemudDomainGetOSType, /* domainGetOSType */
|
qemudDomainGetOSType, /* domainGetOSType */
|
||||||
|
Loading…
Reference in New Issue
Block a user