From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de,
jjherne@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH for-2.5 5/8] s390x: Dump-skeys hmp support
Date: Mon, 20 Jul 2015 15:49:55 +0200 [thread overview]
Message-ID: <1437400198-25382-6-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1437400198-25382-1-git-send-email-cornelia.huck@de.ibm.com>
From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
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 | 16 ++++++++++++++++
hw/s390x/s390-skeys.c | 12 ++++++++++++
include/hw/s390x/storage-keys.h | 2 ++
monitor.c | 4 ++++
4 files changed, 34 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index d3b7932..803ff91 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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?",
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index a7b7a01..5e2948d 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -66,6 +66,18 @@ static void write_keys(FILE *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();
diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-keys.h
index cfd7da7..0d04f19 100644
--- a/include/hw/s390x/storage-keys.h
+++ b/include/hw/s390x/storage-keys.h
@@ -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 */
diff --git a/monitor.c b/monitor.c
index f1501cd..cfe31a4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -82,6 +82,10 @@
#endif
#include "hw/lm32/lm32_pic.h"
+#if defined(TARGET_S390X)
+#include "hw/s390x/storage-keys.h"
+#endif
+
/*
* Supported types:
*
--
2.4.6
next prev parent reply other threads:[~2015-07-20 13:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 13:49 [Qemu-devel] [PATCH for-2.5 0/8] s390x: storage key migration Cornelia Huck
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 1/8] s390x: add 2.5 compat s390-ccw-virtio machine Cornelia Huck
2015-07-20 13:58 ` Christian Borntraeger
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 2/8] s390x: Create QOM device for s390 storage keys Cornelia Huck
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 3/8] s390x: Enable new s390-storage-keys device Cornelia Huck
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 4/8] s390x: Dump storage keys qmp command Cornelia Huck
2015-07-20 14:32 ` Eric Blake
2015-07-20 13:49 ` Cornelia Huck [this message]
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 6/8] s390x: Info skeys sub-command Cornelia Huck
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 7/8] s390x: Migrate guest storage keys (initial memory only) Cornelia Huck
2015-07-21 8:08 ` Thomas Huth
2015-07-21 10:37 ` David Hildenbrand
2015-07-30 15:00 ` Jason J. Herne
2015-07-30 15:12 ` Thomas Huth
2015-08-13 14:11 ` Jason J. Herne
2015-08-13 15:44 ` Christian Borntraeger
2015-07-20 13:49 ` [Qemu-devel] [PATCH for-2.5 8/8] s390x: Disable storage key migration on old machine type Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437400198-25382-6-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=jjherne@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).