From patchwork Mon Nov 23 08:58:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 547545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 277B51402A0 for ; Tue, 24 Nov 2015 00:53:39 +1100 (AEDT) Received: from localhost ([::1]:60620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0rYn-0007L7-CN for incoming@patchwork.ozlabs.org; Mon, 23 Nov 2015 08:53:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0mxn-00035N-5y for qemu-devel@nongnu.org; Mon, 23 Nov 2015 03:59:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0mxm-0000uw-2j for qemu-devel@nongnu.org; Mon, 23 Nov 2015 03:59:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0mxl-0000ul-Ro for qemu-devel@nongnu.org; Mon, 23 Nov 2015 03:59:06 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 80462C0F1CE4 for ; Mon, 23 Nov 2015 08:59:05 +0000 (UTC) Received: from pxdev.xzpeter.org.com (vpn1-7-145.pek2.redhat.com [10.72.7.145]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAN8wwI0024376; Mon, 23 Nov 2015 03:59:02 -0500 From: Peter Xu To: qemu-devel@nongnu.org Date: Mon, 23 Nov 2015 16:58:55 +0800 Message-Id: <1448269136-12614-2-git-send-email-peterx@redhat.com> In-Reply-To: <1448269136-12614-1-git-send-email-peterx@redhat.com> References: <1448269136-12614-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Mon, 23 Nov 2015 08:51:47 -0500 Cc: Peter Xu Subject: [Qemu-devel] [PATCH 1/2] dump-guest-memory: add "detach" flag for QMP/HMP interfaces X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch only add the interfaces, but not implementing them. Signed-off-by: Peter Xu --- dump.c | 3 ++- hmp-commands.hx | 5 +++-- hmp.c | 3 ++- qapi-schema.json | 3 ++- qmp-commands.hx | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dump.c b/dump.c index 78b7d84..3ec3423 100644 --- a/dump.c +++ b/dump.c @@ -1598,7 +1598,8 @@ cleanup: void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin, int64_t begin, bool has_length, int64_t length, bool has_format, - DumpGuestMemoryFormat format, Error **errp) + DumpGuestMemoryFormat format, bool detach, + Error **errp) { const char *p; int fd = -1; diff --git a/hmp-commands.hx b/hmp-commands.hx index bb52e4d..8e27671 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1056,10 +1056,11 @@ ETEXI { .name = "dump-guest-memory", - .args_type = "paging:-p,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?", - .params = "[-p] [-z|-l|-s] filename [begin length]", + .args_type = "paging:-p,detach:-d,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?", + .params = "[-p] [-d] [-z|-l|-s] filename [begin length]", .help = "dump guest memory into file 'filename'.\n\t\t\t" "-p: do paging to get guest's memory mapping.\n\t\t\t" + "-d: return immediately (not wait for completion).\n\t\t\t" "-z: dump in kdump-compressed format, with zlib compression.\n\t\t\t" "-l: dump in kdump-compressed format, with lzo compression.\n\t\t\t" "-s: dump in kdump-compressed format, with snappy compression.\n\t\t\t" diff --git a/hmp.c b/hmp.c index 2140605..4c5480d 100644 --- a/hmp.c +++ b/hmp.c @@ -1580,6 +1580,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict) { Error *err = NULL; bool paging = qdict_get_try_bool(qdict, "paging", false); + bool detach = qdict_get_try_bool(qdict, "detach", false); bool zlib = qdict_get_try_bool(qdict, "zlib", false); bool lzo = qdict_get_try_bool(qdict, "lzo", false); bool snappy = qdict_get_try_bool(qdict, "snappy", false); @@ -1619,7 +1620,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict) prot = g_strconcat("file:", file, NULL); qmp_dump_guest_memory(paging, prot, has_begin, begin, has_length, length, - true, dump_format, &err); + true, dump_format, detach, &err); hmp_handle_error(mon, &err); g_free(prot); } diff --git a/qapi-schema.json b/qapi-schema.json index 8b1a423..1211082 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2132,7 +2132,8 @@ ## { 'command': 'dump-guest-memory', 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int', - '*length': 'int', '*format': 'DumpGuestMemoryFormat' } } + '*length': 'int', '*format': 'DumpGuestMemoryFormat', + 'detach': 'bool'} } ## # @DumpGuestMemoryCapability: diff --git a/qmp-commands.hx b/qmp-commands.hx index 9d8b42f..86864f6 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -840,8 +840,8 @@ EQMP { .name = "dump-guest-memory", - .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?", - .params = "-p protocol [begin] [length] [format]", + .args_type = "paging:b,detach:d,protocol:s,begin:i?,end:i?,format:s?", + .params = "-p protocol [-d] [begin] [length] [format]", .help = "dump guest memory to file", .mhandler.cmd_new = qmp_marshal_dump_guest_memory, },