From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqgPj-0004Ju-55 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 04:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqgPb-0005Qh-Lr for qemu-devel@nongnu.org; Mon, 16 Jul 2012 04:12:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqgPb-0005QD-Di for qemu-devel@nongnu.org; Mon, 16 Jul 2012 04:12:11 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6G8CAgb006717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Jul 2012 04:12:10 -0400 Message-ID: <5003CCD8.7070308@redhat.com> Date: Mon, 16 Jul 2012 10:12:08 +0200 From: Pavel Hrdina MIME-Version: 1.0 References: <03cf631acdeac4654b1d7d8505d9d5f133ea6e6c.1342092497.git.phrdina@redhat.com> <4FFF0F34.4030507@redhat.com> In-Reply-To: <4FFF0F34.4030507@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/4] qapi: Convert savevm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org On 07/12/2012 07:53 PM, Eric Blake wrote: > On 07/12/2012 10:55 AM, Pavel Hrdina wrote: >> Signed-off-by: Pavel Hrdina >> --- >> +++ b/qapi-schema.json >> @@ -1868,3 +1868,25 @@ >> # Since: 0.14.0 >> ## >> { 'command': 'netdev_del', 'data': {'id': 'str'} } >> + >> +## >> +# @savevm: >> +# >> +# Create a snapshot of the whole virtual machine. If 'tag' is provided, >> +# it is used as human readable identifier. If there is already a snapshot >> +# with the same tag or ID, it is replaced. >> +# >> +# @name: tag or id of new or existing snapshot > Needs an #optional designation, given the syntax below. > >> +# >> +# Returns: Nothing on success >> +# If there is a writable device not supporting snapshots, >> +# SnapshotNotSupported >> +# If no block device can accept snapshots, SnapshotNotAccepted >> +# If an error occures while creating a snapshot, SnapshotCreateFailed > s/occures/occurs/ > >> +# If open a block device for vm state fail, SnapshotOpenFailed >> +# If an error uccures while writing vm state, SnapshotWriteFailed > s/uccures/occurs/ > >> +# If delete snapshot with same 'name' fail, SnapshotDeleteFailed > The notion of blindly overwriting the existing snapshot of the same name > seems a bit dangerous; should we take this opportunity to enhance the > command, and add a force flag, where things fail if the flag is false > but the name already exists, and where the reuse only happens if the > flag is present? (In fact, it would make my life in libvirt easier, as > I have an action item to make libvirt reject attempts to create a > snapshot with tag named '1' if an existing snapshot already has an id of > '1'.) This sounds reasonable and I think that this could be also good for HMP, not only for QMP. If there isn't anyone who disagree, I'll implement it. Pavel >> +# >> +# Since: 1.2 >> +## >> +{ 'command': 'savevm', 'data': {'*name': 'str'} } >> \ No newline at end of file > Fix that. > >> @@ -1061,6 +1061,32 @@ Example: >> >> EQMP >> { >> + .name = "savevm", >> + .args_type = "name:s?", >> + .params = "name", >> + .help = "save a VM snapshot. If no tag or id are provided, a new snapshot is created", >> + .mhandler.cmd_new = qmp_marshal_input_savevm >> + }, >> + >> +SQMP >> +savevm > I know the HMP command is short, for ease of typing; but since 'savevm' > is not an English word, should we name the QMP command 'save-vm'? >