]> git.proxmox.com Git - mirror_qemu.git/commitdiff
s390x: Dump-skeys hmp support
authorJason J. Herne <jjherne@linux.vnet.ibm.com>
Fri, 26 Jun 2015 18:07:21 +0000 (14:07 -0400)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 3 Sep 2015 10:17:54 +0000 (12:17 +0200)
Add dump-skeys command to the human monitor.

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hmp-commands.hx
hw/s390x/s390-skeys.c
include/hw/s390x/storage-keys.h
monitor.c

index d3b7932ff6331fa95ba8127c98bf527773d6cc7e..803ff916c2dbdb427fc7fd18a1a40ad10802ab37 100644 (file)
@@ -1053,6 +1053,22 @@ gdb. Without -z|-l|-s, the dump format is ELF.
             together with begin.
 ETEXI
 
+#if defined(TARGET_S390X)
+    {
+        .name       = "dump-skeys",
+        .args_type  = "filename:F",
+        .params     = "",
+        .help       = "Save guest storage keys into file 'filename'.\n",
+        .mhandler.cmd = hmp_dump_skeys,
+    },
+#endif
+
+STEXI
+@item dump-skeys @var{filename}
+@findex dump-skeys
+Save guest storage keys to a file.
+ETEXI
+
     {
         .name       = "snapshot_blkdev",
         .args_type  = "reuse:-n,device:B,snapshot-file:s?,format:s?",
index a1d10a9897492690e274c6fd6712660ffff66a44..98a69385235f93776a492199107b37b331a7307d 100644 (file)
@@ -66,6 +66,18 @@ static void write_keys(QEMUFile *f, uint8_t *keys, uint64_t startgfn,
     }
 }
 
+void hmp_dump_skeys(Monitor *mon, const QDict *qdict)
+{
+    const char *filename = qdict_get_str(qdict, "filename");
+    Error *err = NULL;
+
+    qmp_dump_skeys(filename, &err);
+    if (err) {
+        monitor_printf(mon, "%s\n", error_get_pretty(err));
+        error_free(err);
+    }
+}
+
 void qmp_dump_skeys(const char *filename, Error **errp)
 {
     S390SKeysState *ss = s390_get_skeys_device();
index cfd7da79a41d9944f38b5a844f273ef34eefde57..0d04f196dadbd1ee0c0466c17d2dd4f01b4ea93d 100644 (file)
@@ -13,6 +13,7 @@
 #define __S390_STORAGE_KEYS_H
 
 #include <hw/qdev.h>
+#include "monitor/monitor.h"
 
 #define TYPE_S390_SKEYS "s390-skeys"
 #define S390_SKEYS(obj) \
@@ -52,4 +53,5 @@ void s390_skeys_init(void);
 
 S390SKeysState *s390_get_skeys_device(void);
 
+void hmp_dump_skeys(Monitor *mon, const QDict *qdict);
 #endif /* __S390_STORAGE_KEYS_H */
index daa3d98cf386d02d9cc0a4c13b210b02cbe6353c..3deba38105838aa3deb8631f145f2e80433f538d 100644 (file)
--- a/monitor.c
+++ b/monitor.c
 #endif
 #include "hw/lm32/lm32_pic.h"
 
+#if defined(TARGET_S390X)
+#include "hw/s390x/storage-keys.h"
+#endif
+
 /*
  * Supported types:
  *