From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUGop-0002U4-PT for qemu-devel@nongnu.org; Tue, 25 Aug 2015 12:11:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUGom-00022a-Dv for qemu-devel@nongnu.org; Tue, 25 Aug 2015 12:11:27 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:43994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUGom-00021X-4c for qemu-devel@nongnu.org; Tue, 25 Aug 2015 12:11:24 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Aug 2015 17:11:19 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id BD656219006A for ; Tue, 25 Aug 2015 17:10:46 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7PGBDFm18481378 for ; Tue, 25 Aug 2015 16:11:13 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7PGB3sN017661 for ; Tue, 25 Aug 2015 10:11:04 -0600 From: Cornelia Huck Date: Tue, 25 Aug 2015 18:10:47 +0200 Message-Id: <1440519050-17986-6-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1440519050-17986-1-git-send-email-cornelia.huck@de.ibm.com> References: <1440519050-17986-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH v2 5/8] s390x: Dump-skeys hmp support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, jjherne@linux.vnet.ibm.com From: "Jason J. Herne" Add dump-skeys command to the human monitor. Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand Signed-off-by: Jason J. Herne Signed-off-by: Cornelia Huck --- 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 ebf6a54..f6a29ab 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -72,6 +72,18 @@ static void write_keys(QEMUFile *f, uint8_t *keys, uint64_t startgfn, g_free(buf); } +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 +#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 daa3d98..3deba38 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.5.0