aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/pvpanic.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc/pvpanic.c')
-rw-r--r--hw/misc/pvpanic.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index d65ac86478..abb10bbcaf 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -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"
@@ -111,7 +118,7 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pvpanic_isa_realizefn;
- dc->props = pvpanic_isa_properties;
+ device_class_set_props(dc, pvpanic_isa_properties);
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}