[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 31/88] hw/misc/pvpanic: centralize definition of supported even
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 31/88] hw/misc/pvpanic: centralize definition of supported events |
Date: |
Tue, 2 Jul 2024 16:17:06 -0400 |
From: Thomas Weißschuh <thomas@t-8ch.de>
The different components of pvpanic duplicate the list of supported
events. Move it to the shared header file to minimize changes when new
events are added.
MST: tweak: keep header included in pvpanic.c to avoid header
dependency, rebase.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Message-Id: <20240527-pvpanic-shutdown-v8-3-5a28ec02558b@t-8ch.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/misc/pvpanic.h | 4 ++++
hw/misc/pvpanic-isa.c | 3 +--
hw/misc/pvpanic-pci.c | 2 +-
hw/misc/pvpanic.c | 2 +-
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h
index fab94165d0..1e5b20e4ed 100644
--- a/include/hw/misc/pvpanic.h
+++ b/include/hw/misc/pvpanic.h
@@ -18,6 +18,10 @@
#include "exec/memory.h"
#include "qom/object.h"
+#include "standard-headers/misc/pvpanic.h"
+
+#define PVPANIC_EVENTS (PVPANIC_PANICKED | PVPANIC_CRASH_LOADED)
+
#define TYPE_PVPANIC_ISA_DEVICE "pvpanic"
#define TYPE_PVPANIC_PCI_DEVICE "pvpanic-pci"
diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c
index b4f84c4110..9a923b7869 100644
--- a/hw/misc/pvpanic-isa.c
+++ b/hw/misc/pvpanic-isa.c
@@ -21,7 +21,6 @@
#include "hw/misc/pvpanic.h"
#include "qom/object.h"
#include "hw/isa/isa.h"
-#include "standard-headers/misc/pvpanic.h"
#include "hw/acpi/acpi_aml_interface.h"
OBJECT_DECLARE_SIMPLE_TYPE(PVPanicISAState, PVPANIC_ISA_DEVICE)
@@ -102,7 +101,7 @@ static void build_pvpanic_isa_aml(AcpiDevAmlIf *adev, Aml
*scope)
static Property pvpanic_isa_properties[] = {
DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicISAState, ioport, 0x505),
DEFINE_PROP_UINT8("events", PVPanicISAState, pvpanic.events,
- PVPANIC_PANICKED | PVPANIC_CRASH_LOADED),
+ PVPANIC_EVENTS),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/misc/pvpanic-pci.c b/hw/misc/pvpanic-pci.c
index 4d44a881da..106d03ccd6 100644
--- a/hw/misc/pvpanic-pci.c
+++ b/hw/misc/pvpanic-pci.c
@@ -55,7 +55,7 @@ static void pvpanic_pci_realizefn(PCIDevice *dev, Error
**errp)
static Property pvpanic_pci_properties[] = {
DEFINE_PROP_UINT8("events", PVPanicPCIState, pvpanic.events,
- PVPANIC_PANICKED | PVPANIC_CRASH_LOADED),
+ PVPANIC_EVENTS),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 80289ecf5f..4b2307d2c2 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -27,7 +27,7 @@ static void handle_event(int event)
{
static bool logged;
- if (event & ~(PVPANIC_PANICKED | PVPANIC_CRASH_LOADED) && !logged) {
+ if (event & ~PVPANIC_EVENTS && !logged) {
qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event);
logged = true;
}
--
MST
- [PULL v2 22/88] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument, (continued)
- [PULL v2 22/88] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument, Michael S. Tsirkin, 2024/07/02
- [PULL v2 24/88] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support, Michael S. Tsirkin, 2024/07/02
- [PULL v2 23/88] hw/mem/cxl_type3: Add host backend and address space handling for DC regions, Michael S. Tsirkin, 2024/07/02
- [PULL v2 27/88] hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions, Michael S. Tsirkin, 2024/07/02
- [PULL v2 25/88] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response, Michael S. Tsirkin, 2024/07/02
- [PULL v2 28/88] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support, Michael S. Tsirkin, 2024/07/02
- [PULL v2 29/88] hw/mem/cxl_type3: Allow to release extent superset in QMP interface, Michael S. Tsirkin, 2024/07/02
- [PULL v2 18/88] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command, Michael S. Tsirkin, 2024/07/02
- [PULL v2 26/88] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents, Michael S. Tsirkin, 2024/07/02
- [PULL v2 30/88] linux-headers: update to 6.10-rc1, Michael S. Tsirkin, 2024/07/02
- [PULL v2 31/88] hw/misc/pvpanic: centralize definition of supported events,
Michael S. Tsirkin <=
- [PULL v2 33/88] hw/misc/pvpanic: add support for normal shutdowns, Michael S. Tsirkin, 2024/07/02
- [PULL v2 34/88] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal, Michael S. Tsirkin, 2024/07/02
- [PULL v2 13/88] vhost-user-gpu: fix import of DMABUF, Michael S. Tsirkin, 2024/07/02
- [PULL v2 32/88] tests/qtest/pvpanic: use centralized definition of supported events, Michael S. Tsirkin, 2024/07/02
- [PULL v2 35/88] tests/qtest/pvpanic: add tests for pvshutdown event, Michael S. Tsirkin, 2024/07/02
- [PULL v2 36/88] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Michael S. Tsirkin, 2024/07/02
- [PULL v2 37/88] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(), Michael S. Tsirkin, 2024/07/02
- [PULL v2 39/88] virtio-pci: implement No_Soft_Reset bit, Michael S. Tsirkin, 2024/07/02
- [PULL v2 40/88] vhost-user-test: no set non-blocking for cal fd less than 0., Michael S. Tsirkin, 2024/07/02
- [PULL v2 41/88] i386/apic: Add hint on boot failure because of disabling x2APIC, Michael S. Tsirkin, 2024/07/02