[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/43] Added generic panic handler qemu_system_guest_
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/43] Added generic panic handler qemu_system_guest_panicked() |
Date: |
Wed, 9 Sep 2015 15:49:37 +0200 |
From: Andrey Smetanin <address@hidden>
There are pieces of guest panic handling code
that can be shared in one generic function.
These code replaced by call qemu_system_guest_panicked().
Signed-off-by: Andrey Smetanin <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Paolo Bonzini <address@hidden>
CC: Andreas Färber <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/misc/pvpanic.c | 3 +--
include/sysemu/sysemu.h | 1 +
target-s390x/kvm.c | 11 ++---------
vl.c | 6 ++++++
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 994f8af..3709488 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -41,8 +41,7 @@ static void handle_event(int event)
}
if (event & PVPANIC_PANICKED) {
- qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);
- vm_stop(RUN_STATE_GUEST_PANICKED);
+ qemu_system_guest_panicked();
return;
}
}
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 44570d1..1f6ff8f 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -69,6 +69,7 @@ int qemu_reset_requested_get(void);
void qemu_system_killed(int signal, pid_t pid);
void qemu_devices_reset(void);
void qemu_system_reset(bool report);
+void qemu_system_guest_panicked(void);
void qemu_add_exit_notifier(Notifier *notify);
void qemu_remove_exit_notifier(Notifier *notify);
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index ae3a0af..ba1201e 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -1796,13 +1796,6 @@ static bool is_special_wait_psw(CPUState *cs)
return cs->kvm_run->psw_addr == 0xfffUL;
}
-static void guest_panicked(void)
-{
- qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE,
- &error_abort);
- vm_stop(RUN_STATE_GUEST_PANICKED);
-}
-
static void unmanageable_intercept(S390CPU *cpu, const char *str, int
pswoffset)
{
CPUState *cs = CPU(cpu);
@@ -1811,7 +1804,7 @@ static void unmanageable_intercept(S390CPU *cpu, const
char *str, int pswoffset)
str, cs->cpu_index, ldq_phys(cs->as, cpu->env.psa +
pswoffset),
ldq_phys(cs->as, cpu->env.psa + pswoffset + 8));
s390_cpu_halt(cpu);
- guest_panicked();
+ qemu_system_guest_panicked();
}
static int handle_intercept(S390CPU *cpu)
@@ -1844,7 +1837,7 @@ static int handle_intercept(S390CPU *cpu)
if (is_special_wait_psw(cs)) {
qemu_system_shutdown_request();
} else {
- guest_panicked();
+ qemu_system_guest_panicked();
}
}
r = EXCP_HALTED;
diff --git a/vl.c b/vl.c
index 584ca88..c1508a6 100644
--- a/vl.c
+++ b/vl.c
@@ -1740,6 +1740,12 @@ void qemu_system_reset(bool report)
cpu_synchronize_all_post_reset();
}
+void qemu_system_guest_panicked(void)
+{
+ qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);
+ vm_stop(RUN_STATE_GUEST_PANICKED);
+}
+
void qemu_system_reset_request(void)
{
if (no_reboot) {
--
2.4.3
- [Qemu-devel] [PULL 00/43] First batch of misc changes for 2.5 (2015-09-09), Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 02/43] seqlock: add missing 'inline' to seqlock_read_retry, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 01/43] qemu-thread: handle spurious futex_wait wakeups, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 03/43] seqlock: read sequence number atomically, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 04/43] cpus.c: qemu_mutex_lock_iothread fix race condition at cpu thread init, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 05/43] iohandler: Use aio API, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 08/43] i8257: rewrite DMA_schedule to avoid hooking into the CPU loop, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 06/43] block/iscsi: validate block size returned from target, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 10/43] tcg: introduce tcg_current_cpu, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 07/43] Added generic panic handler qemu_system_guest_panicked(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 09/43] i8257: remove cpu_request_exit irq, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 14/43] tcg: synchronize exit_request and tcg_current_cpu accesses, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 15/43] use qemu_cpu_kick instead of cpu_exit or qemu_cpu_kick_thread, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 11/43] remove qemu/tls.h, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 13/43] tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 16/43] tcg: signal-free qemu_cpu_kick, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 12/43] tcg: assign cpu->current_tb in a simpler place, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 18/43] Makefile.target: include top level build dir in vpath, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 17/43] Move RAMBlock and ram_list to ram_addr.h, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 22/43] translate-all: remove obsolete comment about l1_map, Paolo Bonzini, 2015/09/09