mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
Add API for the 'system_powerdown' monitor command
* src/qemu/qemu_driver.c: Remove use of 'system_powerdown' * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new qemuMonitorSystemPowerdown() api call
This commit is contained in:
parent
1e64d8c731
commit
19d70c7d96
@ -2841,7 +2841,6 @@ cleanup:
|
||||
static int qemudDomainShutdown(virDomainPtr dom) {
|
||||
struct qemud_driver *driver = dom->conn->privateData;
|
||||
virDomainObjPtr vm;
|
||||
char* info;
|
||||
int ret = -1;
|
||||
|
||||
qemuDriverLock(driver);
|
||||
@ -2862,12 +2861,9 @@ static int qemudDomainShutdown(virDomainPtr dom) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemudMonitorCommand(vm, "system_powerdown", &info) < 0) {
|
||||
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
|
||||
"%s", _("shutdown operation failed"));
|
||||
if (qemuMonitorSystemPowerdown(vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(info);
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
@ -451,6 +451,20 @@ qemuMonitorStopCPUs(const virDomainObjPtr vm) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int qemuMonitorSystemPowerdown(const virDomainObjPtr vm) {
|
||||
char *info;
|
||||
|
||||
if (qemudMonitorCommand(vm, "system_powerdown", &info) < 0) {
|
||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
||||
"%s", _("system shutdown operation failed"));
|
||||
return -1;
|
||||
}
|
||||
VIR_FREE(info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int qemuMonitorGetCPUInfo(const virDomainObjPtr vm,
|
||||
int **pids)
|
||||
{
|
||||
|
@ -69,6 +69,8 @@ int qemuMonitorStartCPUs(virConnectPtr conn,
|
||||
const virDomainObjPtr vm);
|
||||
int qemuMonitorStopCPUs(const virDomainObjPtr vm);
|
||||
|
||||
int qemuMonitorSystemPowerdown(const virDomainObjPtr vm);
|
||||
|
||||
int qemuMonitorGetCPUInfo(const virDomainObjPtr vm,
|
||||
int **pids);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user