summary refs log tree commit diff stats
path: root/include
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-10 16:14:12 +0100
committerThomas Huth <thuth@redhat.com>2025-04-23 07:51:25 +0200
commit3f979fe13e405d5721f3b43b5669a462f4816569 (patch)
tree49c90f89ef21db71594e7042c14eae3518a7c073 /include
parent4b91f6d16d4e50cf0f19d74f318d0ba61f90cc64 (diff)
downloadfocaccia-qemu-3f979fe13e405d5721f3b43b5669a462f4816569.tar.gz
focaccia-qemu-3f979fe13e405d5721f3b43b5669a462f4816569.zip
hw/s390x/skeys: Introduce TYPE_DUMP_SKEYS_INTERFACE
The storage keys are part of the machine memory.

Introduce the TYPE_DUMP_SKEYS_INTERFACE type,
allowing machine using storage keys to dump them
when a DumpSKeysInterface::qmp_dump_skeys() callback
is provided.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250310151414.11550-3-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/s390x/storage-keys.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-keys.h
index 408d2815d4..fb766d4631 100644
--- a/include/hw/s390x/storage-keys.h
+++ b/include/hw/s390x/storage-keys.h
@@ -125,4 +125,19 @@ S390SKeysState *s390_get_skeys_device(void);
 void hmp_dump_skeys(Monitor *mon, const QDict *qdict);
 void hmp_info_skeys(Monitor *mon, const QDict *qdict);
 
+#define TYPE_DUMP_SKEYS_INTERFACE "dump-skeys-interface"
+
+typedef struct DumpSKeysInterface DumpSKeysInterface;
+DECLARE_CLASS_CHECKERS(DumpSKeysInterface, DUMP_SKEYS_INTERFACE,
+                       TYPE_DUMP_SKEYS_INTERFACE)
+
+struct DumpSKeysInterface {
+    InterfaceClass parent_class;
+
+    /**
+     * @qmp_dump_skeys: Callback to dump guest's storage keys to @filename.
+     */
+    void (*qmp_dump_skeys)(const char *filename, Error **errp);
+};
+
 #endif /* S390_STORAGE_KEYS_H */