From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua04d-0006nF-Gd for qemu-devel@nongnu.org; Wed, 08 May 2013 04:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ua04W-0004xu-Ud for qemu-devel@nongnu.org; Wed, 08 May 2013 04:50:07 -0400 Received: from [222.73.24.84] (port=22670 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua04W-0004xQ-Ey for qemu-devel@nongnu.org; Wed, 08 May 2013 04:50:00 -0400 From: "qiaonuohan" References: <1367911007-13990-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1367911007-13990-10-git-send-email-qiaonuohan@cn.fujitsu.com> <5189362E.3030707@redhat.com> In-Reply-To: <5189362E.3030707@redhat.com> Date: Wed, 8 May 2013 16:50:17 +0800 Message-ID: <004301ce4bc9$11040970$330c1c50$@cn.fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Content-Language: zh-cn Subject: Re: [Qemu-devel] [PATCH 9/9] Make monitor command 'dump-guest-memory' dump in kdump-compressed format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Eric Blake' Cc: 'Zhang Xiaohe' , qemu-devel@nongnu.org > -----Original Message----- > From: Eric Blake [mailto:eblake@redhat.com] > Sent: Wednesday, May 08, 2013 1:13 AM > To: Qiao Nuohan > Cc: qemu-devel@nongnu.org; Zhang Xiaohe > Subject: Re: [Qemu-devel] [PATCH 9/9] Make monitor command 'dump-guest-memory' > dump in kdump-compressed format > > > > + .params = "[-p] filename [flags] [begin] [length]", > > .help = "dump guest memory to file" > > + "\n\t\t\t flags: the type of compression" > > That documentation does nothing for me. What types are valid? > > > +++ b/qapi-schema.json > > @@ -2410,6 +2410,8 @@ > > # 2. fd: the protocol starts with "fd:", and the following > string > > # is the fd's name. > > # > > +# @flags: #optional if specified, the format of dump file. > > +# > > Missing a "(since 1.6)" tag to declare that it was added after the fact. > We probably also ought to solve the introspection issue before adding > this feature, so that QMP clients like libvirt know when this optional > parameter is available for use. Got it. > > > # @begin: #optional if specified, the starting physical address. > > # > > # @length: #optional if specified, the memory size, in bytes. If you don't > > @@ -2421,8 +2423,8 @@ > > # Since: 1.2 > > ## > > { 'command': 'dump-guest-memory', > > - 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int', > > - '*length': 'int' } } > > + 'data': { 'paging': 'bool', 'protocol': 'str', '*flags': 'int', > > + '*begin': 'int', '*length': 'int' } } > > EWWWWW - this is a LOUSY interface. Don't make '*flags' an 'int', and > for that matter, don't name it 'flags' (that implies that we can > bitwise-or multiple compressions together, but it really doesn't make > sense to do both lzo and snappy at the same time - compression really > only makes sense as a single format at a time). Name it for what it > represents (compression type), and provide an enum that lists the valid > types. Something like: > > { 'enum': 'DumpGuestMemoryFormat', > 'data': [ 'uncompressed', 'zlib', 'lzo', 'snappy' ] } > > { 'command': 'dump-guest-memory', > 'data': { '*format': 'DumpGuestMemoryFormat', ... }} Thanks for your suggestion. I will fix it like: { 'enum': 'DumpCompressionFormat', 'data': [ 'zlib', 'lzo', 'snappy' ] } For zlib is treated as the default compression format, and 'uncompressed' won't be an option. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org