From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrPHJ-0004yh-TW for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:38:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrPHI-0004qC-5E for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:38:53 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:34677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrPHH-0004pi-GS for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:38:52 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 5 Jan 2013 18:34:20 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id CE2542BB004E for ; Sat, 5 Jan 2013 19:38:42 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r058RH9d66322618 for ; Sat, 5 Jan 2013 19:27:17 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r058cgOS029209 for ; Sat, 5 Jan 2013 19:38:42 +1100 Message-ID: <50E7E691.8080809@linux.vnet.ibm.com> Date: Sat, 05 Jan 2013 16:38:41 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1355725509-5429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1355725509-5429-6-git-send-email-xiawenc@linux.vnet.ibm.com> <20130104162212.GE6310@stefanha-thinkpad.hitronhub.home> In-Reply-To: <20130104162212.GE6310@stefanha-thinkpad.hitronhub.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 5/6] snapshot: qmp interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, blauwirbel@gmail.com 于 2013-1-5 0:22, Stefan Hajnoczi 写道: > On Mon, Dec 17, 2012 at 02:25:08PM +0800, Wenchao Xia wrote: >> @@ -1478,16 +1497,39 @@ >> # >> # @device: the name of the device to generate the snapshot from. >> # >> -# @snapshot-file: the target of the new image. A new file will be created. >> +# @snapshot-file: the target name of the snapshot. In external case, it is >> +# the new file's name, A new file will be created. In internal >> +# case, it is the internal snapshot record's name and if it is >> +# 'blank' name will be generated according to time. >> # >> # @format: #optional the format of the snapshot image, default is 'qcow2'. >> # >> -# @mode: #optional whether and how QEMU should create a new image, default is >> -# 'absolute-paths'. >> +# @mode: #optional whether QEMU should create a new snapshot or use existing >> +# one, default is 'absolute-paths'. >> +# >> +# @type: #optional internal snapshot or external, default is 'external'. >> +# >> ## >> { 'type': 'BlockdevSnapshot', >> 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str', >> - '*mode': 'NewImageMode' } } >> + '*mode': 'NewImageMode', '*type': 'SnapshotType'} } > > It feels cleaner to define a new BlockdevInternalSnapshot type instead > of overloading the field semantics. The naming doesn't fit for internal > snapshots (e.g. "snapshot-file", "absolute-paths", etc). > > Treat internal snapshots as a new transaction action. That way we can > cleanly add internal snapshot specific fields in the future. The > documentation will be clearer because users won't have to consider the > "if type is 'external', then ..., otherwise ...". > > Stefan > After struggling about the parameter meaning, I guess this is what make things better. -- Best Regards Wenchao Xia