mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-31 00:45:18 +00:00
qemu: lifecycle: make agent-mode shutdown and reboot timeout
When we shutdown/reboot a guest using agent-mode, if the guest itself blocks infinitely, libvirt would block in qemuAgentShutdown() forever. Thus, we set a timeout for shutdown/reboot, from our experience, 60 seconds would be fine. Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com> Signed-off-by: Wang Yufei <james.wangyufei@huawei.com>
This commit is contained in:
parent
d64cd4a4c6
commit
dd725c53e9
@ -49,6 +49,7 @@ typedef enum {
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK = -2,
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = -1,
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = 0,
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = 60,
|
||||
} virDomainQemuAgentCommandTimeoutValues;
|
||||
|
||||
char *virDomainQemuAgentCommand(virDomainPtr domain, const char *cmd,
|
||||
|
@ -1300,7 +1300,7 @@ int qemuAgentShutdown(qemuAgentPtr mon,
|
||||
else
|
||||
mon->await_event = QEMU_AGENT_EVENT_SHUTDOWN;
|
||||
ret = qemuAgentCommand(mon, cmd, &reply, false,
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK);
|
||||
VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN);
|
||||
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
||||
|
Loading…
x
Reference in New Issue
Block a user