@@ -1029,6 +1029,10 @@ int kvm_cpu_exec(CPUState *env)
qemu_system_reset_request();
ret = EXCP_INTERRUPT;
break;
+ case KVM_EXIT_PANIC:
+ panic = 1;
+ ret = 1;
+ break;
case KVM_EXIT_UNKNOWN:
fprintf(stderr, "KVM: unknown exit, hardware reason %" PRIx64 "\n",
(uint64_t)run->hw.hardware_exit_reason);
@@ -161,6 +161,7 @@ struct kvm_pit_config {
#define KVM_EXIT_NMI 16
#define KVM_EXIT_INTERNAL_ERROR 17
#define KVM_EXIT_OSI 18
+#define KVM_EXIT_PANIC 19
/* For KVM_EXIT_INTERNAL_ERROR */
#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -2599,13 +2599,17 @@ static void do_info_status_print(Monitor *mon, const QObject *data)
monitor_printf(mon, "paused");
}
+ if (qdict_get_bool(qdict, "panic")) {
+ monitor_printf(mon, " (panic)");
+ }
+
monitor_printf(mon, "\n");
}
static void do_info_status(Monitor *mon, QObject **ret_data)
{
- *ret_data = qobject_from_jsonf("{ 'running': %i, 'singlestep': %i }",
- vm_running, singlestep);
+ *ret_data = qobject_from_jsonf("{ 'running': %i, 'singlestep': %i, 'panic': %i }",
+ vm_running, singlestep, panic);
}
static qemu_acl *find_acl(Monitor *mon, const char *name)
@@ -12,6 +12,7 @@
extern const char *bios_name;
extern int vm_running;
+extern int panic;
extern const char *qemu_name;
extern uint8_t qemu_uuid[];
int qemu_uuid_parse(const char *str, uint8_t *uuid);
@@ -185,6 +185,7 @@ int mem_prealloc = 0; /* force preallocation of physical target memory */
int nb_nics;
NICInfo nd_table[MAX_NICS];
int vm_running;
+int panic = 0;
int autostart;
int incoming_expected; /* Started with -incoming and waiting for incoming */
static int rtc_utc = 1;
@@ -1407,6 +1408,7 @@ static void main_loop(void)
pause_all_vcpus();
cpu_synchronize_all_states();
qemu_system_reset();
+ panic = 0;
resume_all_vcpus();
}
if (qemu_powerdown_requested()) {