]> git.proxmox.com Git - mirror_qemu.git/commit - vl.c
trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events
authorYang Zhiyong <yangzy.fnst@cn.fujitsu.com>
Sat, 21 Jun 2014 18:43:03 +0000 (02:43 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Jul 2014 08:56:13 +0000 (10:56 +0200)
commitbc78cff9757782501db15d39828e6af4186fe331
tree05b5c92e2d074863b906c12a71d5a0145e968361
parent53a259da5697ec8a82463161e2e32ff942a08bc2
trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events

We have the experience that the guest doesn't stop successfully
though it was instructed to shut down.

The root cause may be not in QEMU mostly.  However, QEMU is often
suspected at the beginning just because the issue occurred in
virtualization environment.

Therefore, we need to affirm that QEMU received the shutdown
request and raised ACPI irq from "virsh shutdown" command,
virt-manger or stopping QEMU process to the VM .
So that we can affirm the problems was belonged to the Guset OS
rather than the QEMU itself.

When we stop guests by "virsh shutdown" command or virt-manger,
or stopping QEMU process, qemu_system_powerdown_request() or
qemu_system_shutdown_request() is called. Then the below functions
in main_loop_should_exit() of Vl.c are called roughly in the
following order.

if (qemu_powerdown_requested())
qemu_system_powerdown()
monitor_protocol_event(QEVENT_POWERDOWN, NULL)

OR

if(qemu_shutdown_requested()}
monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

The tracepoint of monitor_protocol_event() already exists, but no
tracepoints are defined for qemu_system_powerdown_request() and
qemu_system_shutdown_request(). So this patch adds two tracepoints for
the two functions. We believe that it will become much easier to
isolate the problem mentioned above by these tracepoints.

Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace-events
vl.c