提交 a4538a5c 编写于 作者: J Jason J. Herne 提交者: Cornelia Huck

s390x: Dump-skeys hmp support

Add dump-skeys command to the human monitor.
Reviewed-by: NThomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 7ee0c3e3
...@@ -1053,6 +1053,22 @@ gdb. Without -z|-l|-s, the dump format is ELF. ...@@ -1053,6 +1053,22 @@ gdb. Without -z|-l|-s, the dump format is ELF.
together with begin. together with begin.
ETEXI 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", .name = "snapshot_blkdev",
.args_type = "reuse:-n,device:B,snapshot-file:s?,format:s?", .args_type = "reuse:-n,device:B,snapshot-file:s?,format:s?",
......
...@@ -66,6 +66,18 @@ static void write_keys(QEMUFile *f, uint8_t *keys, uint64_t startgfn, ...@@ -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) void qmp_dump_skeys(const char *filename, Error **errp)
{ {
S390SKeysState *ss = s390_get_skeys_device(); S390SKeysState *ss = s390_get_skeys_device();
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define __S390_STORAGE_KEYS_H #define __S390_STORAGE_KEYS_H
#include <hw/qdev.h> #include <hw/qdev.h>
#include "monitor/monitor.h"
#define TYPE_S390_SKEYS "s390-skeys" #define TYPE_S390_SKEYS "s390-skeys"
#define S390_SKEYS(obj) \ #define S390_SKEYS(obj) \
...@@ -52,4 +53,5 @@ void s390_skeys_init(void); ...@@ -52,4 +53,5 @@ void s390_skeys_init(void);
S390SKeysState *s390_get_skeys_device(void); S390SKeysState *s390_get_skeys_device(void);
void hmp_dump_skeys(Monitor *mon, const QDict *qdict);
#endif /* __S390_STORAGE_KEYS_H */ #endif /* __S390_STORAGE_KEYS_H */
...@@ -82,6 +82,10 @@ ...@@ -82,6 +82,10 @@
#endif #endif
#include "hw/lm32/lm32_pic.h" #include "hw/lm32/lm32_pic.h"
#if defined(TARGET_S390X)
#include "hw/s390x/storage-keys.h"
#endif
/* /*
* Supported types: * Supported types:
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册