From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyLlp-0001Dk-Rt for qemu-devel@nongnu.org; Mon, 16 Nov 2015 10:32:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyLll-00031b-3e for qemu-devel@nongnu.org; Mon, 16 Nov 2015 10:32:41 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:5596 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyLlk-00031K-Km for qemu-devel@nongnu.org; Mon, 16 Nov 2015 10:32:37 -0500 From: "Denis V. Lunev" Date: Mon, 16 Nov 2015 18:32:27 +0300 Message-Id: <1447687950-29350-3-git-send-email-den@openvz.org> In-Reply-To: <1447687950-29350-1-git-send-email-den@openvz.org> References: <1447687950-29350-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juan Quintela , qemu-devel@nongnu.org, Markus Armbruster , Amit Shah , "Denis V. Lunev" Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Amit Shah CC: Markus Armbruster CC: Eric Blake --- migration/savevm.c | 5 +++++ qapi-schema.json | 13 +++++++++++++ qmp-commands.hx | 25 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index f83ffd0..565b10a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2010,6 +2010,11 @@ void hmp_savevm(Monitor *mon, const QDict *qdict) } } +void qmp_savevm(bool has_name, const char *name, Error **errp) +{ + do_savevm(has_name ? name : NULL, errp); +} + void qmp_xen_save_devices_state(const char *filename, Error **errp) { QEMUFile *f; diff --git a/qapi-schema.json b/qapi-schema.json index b65905f..8cc8b44 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3962,3 +3962,16 @@ ## { 'enum': 'ReplayMode', 'data': [ 'none', 'record', 'play' ] } + +## +# @savevm +# +# Save a VM snapshot. Without a name new snapshot is created", +# +# @name: identifier of a snapshot to be created +# +# Returns: Nothing on success +# +# Since 2.6 +## +{ 'command': 'savevm', 'data': {'*name': 'str'} } diff --git a/qmp-commands.hx b/qmp-commands.hx index 9d8b42f..cd895f6 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -4739,3 +4739,28 @@ Example: {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840, "pop-vlan": 1, "id": 251658240} ]} + +EQMP + +SQMP +savevm +------------------ + +Save a VM snapshot. If no tag or id are provided, a new snapshot is created + +Arguments: + +- "name": (optional) snapshot name + +Example: + +-> { "execute": "savevm", "arguments": { "name": "snapshot1" } } +<- { "return": {} } + +EQMP + + { + .name = "savevm", + .args_type = "name:s?", + .mhandler.cmd_new = qmp_marshal_savevm, + }, -- 2.5.0