From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZlS9-0003Cm-IF for qemu-devel@nongnu.org; Tue, 07 May 2013 13:13:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZlS7-0004qJ-PI for qemu-devel@nongnu.org; Tue, 07 May 2013 13:13:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZlS7-0004qA-HV for qemu-devel@nongnu.org; Tue, 07 May 2013 13:13:23 -0400 Message-ID: <5189362E.3030707@redhat.com> Date: Tue, 07 May 2013 11:13:18 -0600 From: Eric Blake MIME-Version: 1.0 References: <1367911007-13990-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1367911007-13990-10-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1367911007-13990-10-git-send-email-qiaonuohan@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2LUQAHPQTVJWIFQNRRRMJ" 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: Qiao Nuohan Cc: Zhang Xiaohe , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2LUQAHPQTVJWIFQNRRRMJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/07/2013 01:16 AM, Qiao Nuohan wrote: > Make monitor command 'dump-guest-memory' dump in kdump-compressed forma= t. > The command's usage: > dump [-p] protocol [flags] [begin] [length] > With 'flags' set, the core file will be in kdump-compress format, and w= ithout > it, the format is ELF. 'flags' can be: > 1. FLAG_DUMP_COMPRESS_ZLIB(0x1), compress vmcore with zlib > 2. FLAG_DUMP_COMPRESS_LZO(0x2), compress vmcore with lzo > 3. FLAG_DUMP_COMPRESS_SNAPPY(0x4), compress vmcore with snappy >=20 > Note: > 1. The kdump-compressed format is readable only with the crash utilit= y, and it > can be smaller than the ELF format because of the compression supp= ort. > 2. The kdump-compressed format is the 5th edition. >=20 > Signed-off-by: Qiao Nuohan > Signed-off-by: Zhang Xiaohe > +++ b/hmp-commands.hx > @@ -992,9 +992,10 @@ ETEXI > #if defined(CONFIG_HAVE_CORE_DUMP) > { > .name =3D "dump-guest-memory", > - .args_type =3D "paging:-p,filename:F,begin:i?,length:i?", > - .params =3D "[-p] filename [begin] [length]", > + .args_type =3D "paging:-p,filename:F,flags:i?,begin:i?,length= :i?", This is a backwards-incompatible change to HMP ('dump-guest-memory file 0' used to treat 0 as begin, now it treats it as flags), but I don't care (we've already declared that HMP is unstable). If you want back-compat, then stick flags last, not in the middle. See below about the naming and semantics (I hate the name "flags" for a non-flags item, and making a human user learn flag bit values is a lousy interface). If you fix QMP to have a sane interface, then HMP should probably have a similar change. > + .params =3D "[-p] filename [flags] [begin] [length]", > .help =3D "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. > # @begin: #optional if specified, the starting physical address. > # > # @length: #optional if specified, the memory size, in bytes. If you d= on'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', ... }} --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2LUQAHPQTVJWIFQNRRRMJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRiTYuAAoJEKeha0olJ0NqQfIH/ivp6FPObIBIuB6820bPKlGP MW5+jQRL/OhhixcELK1uGfyay0edqOgI2psoJM0PNVUFAeGM0cnJiQlqUxBYwyKu t+VAlmPw+XhdCkuwK2SAOT2/VGsDC9XX23p2IJZKZpRWOFLx3C8jGsSdqB51NgdH K9GncAy3uG9Gi1ToFNo2ezaMrbl3giZDwOM69e/rRPahoLvrS8lMjg4GP3gG7AYH yajzRdzFzLSBbDAlGQysFm8zjviiQyvIeeTv1ozT7zTKVCVEzMtHbkzwLT6C+qL6 gx3pVNYNDk46fMuGCr9N6MVKlScg7hCurZd7LQZRVv7FXIYYadMwpPhSeLcbiN4= =ScSo -----END PGP SIGNATURE----- ------enig2LUQAHPQTVJWIFQNRRRMJ--