From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcaXk-0006pp-O4 for qemu-devel@nongnu.org; Wed, 15 May 2013 08:10:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcaXj-0004Q6-EB for qemu-devel@nongnu.org; Wed, 15 May 2013 08:10:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcaXj-0004On-1C for qemu-devel@nongnu.org; Wed, 15 May 2013 08:10:51 -0400 Message-ID: <51937B3B.3030909@redhat.com> Date: Wed, 15 May 2013 06:10:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <1368584998-20053-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1368584998-20053-10-git-send-email-qiaonuohan@cn.fujitsu.com> <5192F91A.7090904@redhat.com> <51931CB8.8050301@cn.fujitsu.com> In-Reply-To: <51931CB8.8050301@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2SEAETRWHPPRLSJDSVMUB" Subject: Re: [Qemu-devel] [PATCH 9/9 v2] 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: qemu-devel@nongnu.org, d.hatayama@jp.fujitsu.com, kumagai-atsushi@mxc.nes.nec.co.jp, zhangxh@cn.fujitsu.com, anderson@redhat.com, afaerber@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2SEAETRWHPPRLSJDSVMUB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/14/2013 11:27 PM, Qiao Nuohan wrote: >>> +static int dump_init(DumpState *s, int fd, bool compress_format, >>> + DumpGuestMemoryFormat format, bool paging, >>> + bool has_filter, int64_t begin, int64_t length, >>> Error **errp) >>> { >> >> Why do you need compress_format as a separate parameter, when that >> information is redundant with the contents of format? >=20 > I need this variable to decide whether in kdump-compressed format or > not. Without using it, I need to repeat "has_format && format !=3D > DUMP_GUEST_MEMORY_FORMAT_ELF" three times. Then set it up as a local stack-allocated variable within the function body. No need to pass it as part of the function signature, to make all callers pass redundant information. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2SEAETRWHPPRLSJDSVMUB 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/ iQEcBAEBCAAGBQJRk3s7AAoJEKeha0olJ0NqJpQH/jQ/G5TDBOsMH65EhMrHRtEP YT5R2F/O0Qn4BUzS3RejFMJRq8CLYfjc+QtjwsO6OUyxvxOyGVzMiMU8GNxD+XFF 3aanSmC0QGt9QzTooUp8UPfz70x/nkVoVzJSFJCGyClAdGHInH6xvLyFQsi4rIpq kKorrVLD8k+r1NOLmbSKx7OyxvISVB2rH8OlDgNCcf69ds7COi3zFVTAemY+KDHN iPuhmPKg9pM5LDIh3qrv4w3VETG+FIxIVuerHCOBxFdFRBEfYy16ahzJZnZ4gpsq Dhp+6/Vu95FQtvGuv19fFMeBKcDm3NSP6xuuDRv+pEqQE6doeiXljWUK/rIiYgw= =jRnA -----END PGP SIGNATURE----- ------enig2SEAETRWHPPRLSJDSVMUB--