@@ -264,3 +264,16 @@ Example:
Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
followed respectively by the RESET, SHUTDOWN, or STOP events.
+
+
+PANIC
+-----
+
+Emitted when the guest panics.
+
+Data: None.
+
+Example:
+
+{ "timestamp": {"seconds": 1308569038, "microseconds": 918147},
+ "event": "PANIC"}
@@ -1030,7 +1030,8 @@ int kvm_cpu_exec(CPUState *env)
ret = EXCP_INTERRUPT;
break;
case KVM_EXIT_PANIC:
- panic = 1;
+ DPRINTF("panic\n");
+ qemu_system_panic_request();
ret = 1;
break;
case KVM_EXIT_UNKNOWN:
@@ -468,6 +468,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
case QEVENT_SPICE_DISCONNECTED:
event_name = "SPICE_DISCONNECTED";
break;
+ case QEVENT_PANIC:
+ event_name = "PANIC";
+ break;
default:
abort();
break;
@@ -35,6 +35,7 @@ typedef enum MonitorEvent {
QEVENT_SPICE_CONNECTED,
QEVENT_SPICE_INITIALIZED,
QEVENT_SPICE_DISCONNECTED,
+ QEVENT_PANIC,
QEVENT_MAX,
} MonitorEvent;
@@ -43,11 +43,13 @@ void qemu_system_shutdown_request(void);
void qemu_system_powerdown_request(void);
void qemu_system_debug_request(void);
void qemu_system_vmstop_request(int reason);
+void qemu_system_panic_request(void);
int qemu_shutdown_requested_get(void);
int qemu_reset_requested_get(void);
int qemu_shutdown_requested(void);
int qemu_reset_requested(void);
int qemu_powerdown_requested(void);
+int qemu_panic_requested(void);
void qemu_system_killed(int signal, pid_t pid);
void qemu_kill_report(void);
extern qemu_irq qemu_system_powerdown;
@@ -1173,6 +1173,7 @@ static pid_t shutdown_pid;
static int powerdown_requested;
static int debug_requested;
static int vmstop_requested;
+static int panic_requested;
int qemu_shutdown_requested_get(void)
{
@@ -1235,6 +1236,13 @@ static int qemu_vmstop_requested(void)
return r;
}
+int qemu_panic_requested(void)
+{
+ int r = panic_requested;
+ panic_requested = 0;
+ return r;
+}
+
void qemu_register_reset(QEMUResetHandler *func, void *opaque)
{
QEMUResetEntry *re = qemu_mallocz(sizeof(QEMUResetEntry));
@@ -1311,6 +1319,13 @@ void qemu_system_vmstop_request(int reason)
qemu_notify_event();
}
+void qemu_system_panic_request(void)
+{
+ panic = 1;
+ panic_requested = 1;
+ qemu_notify_event();
+}
+
void main_loop_wait(int nonblocking)
{
fd_set rfds, wfds, xfds;
@@ -1418,6 +1433,9 @@ static void main_loop(void)
if ((r = qemu_vmstop_requested())) {
vm_stop(r);
}
+ if (qemu_panic_requested()) {
+ monitor_protocol_event(QEVENT_PANIC, NULL);
+ }
}
bdrv_close_all();
pause_all_vcpus();
Emitted when the guest panics. For now only if KVM_EXIT_PANIC got triggered. Signed-off-by: Daniel Gollub <gollub@b1-systems.de> --- QMP/qmp-events.txt | 13 +++++++++++++ kvm-all.c | 3 ++- monitor.c | 3 +++ monitor.h | 1 + sysemu.h | 2 ++ vl.c | 18 ++++++++++++++++++ 6 files changed, 39 insertions(+), 1 deletions(-)