提交 78f2cd3d 编写于 作者: D Daniel P. Berrange

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

上级 8796a9ff
......@@ -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....]
......
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册