mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
pvpanic: implement crashloaded event handling
Handle bit 1 write, then post event to monitor. Suggested by Paolo, declear a new event, using GUEST_PANICKED could cause upper layers to react by shutting down or rebooting the guest. In advance for extention, add GuestPanicInformation in event message. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20200114023102.612548-3-pizhenwei@bytedance.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
600d7b47e8
commit
7dc58deea7
5 changed files with 52 additions and 12 deletions
|
@ -21,11 +21,13 @@
|
|||
#include "hw/qdev-properties.h"
|
||||
#include "hw/misc/pvpanic.h"
|
||||
|
||||
/* The bit of supported pv event */
|
||||
/* The bit of supported pv event, TODO: include uapi header and remove this */
|
||||
#define PVPANIC_F_PANICKED 0
|
||||
#define PVPANIC_F_CRASHLOADED 1
|
||||
|
||||
/* The pv event value */
|
||||
#define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED)
|
||||
#define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED)
|
||||
|
||||
#define ISA_PVPANIC_DEVICE(obj) \
|
||||
OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC)
|
||||
|
@ -34,7 +36,7 @@ static void handle_event(int event)
|
|||
{
|
||||
static bool logged;
|
||||
|
||||
if (event & ~PVPANIC_PANICKED && !logged) {
|
||||
if (event & ~(PVPANIC_PANICKED | PVPANIC_CRASHLOADED) && !logged) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event);
|
||||
logged = true;
|
||||
}
|
||||
|
@ -43,6 +45,11 @@ static void handle_event(int event)
|
|||
qemu_system_guest_panicked(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event & PVPANIC_CRASHLOADED) {
|
||||
qemu_system_guest_crashloaded(NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#include "hw/isa/isa.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue