From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE5Ql-0003M1-UM for qemu-devel@nongnu.org; Fri, 08 Mar 2013 17:06:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UE5Qb-0006ye-U0 for qemu-devel@nongnu.org; Fri, 08 Mar 2013 17:06:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE5Qb-0006yZ-Lk for qemu-devel@nongnu.org; Fri, 08 Mar 2013 17:06:13 -0500 Message-ID: <513A6074.1070006@redhat.com> Date: Fri, 08 Mar 2013 15:04:36 -0700 From: Eric Blake MIME-Version: 1.0 References: <1362636445-7188-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1362636445-7188-7-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1362636445-7188-7-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2OPJAVGVHCIVSPEUQIXLA" Subject: Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OPJAVGVHCIVSPEUQIXLA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/06/2013 11:07 PM, Wenchao Xia wrote: > This patch is just for making review easier, those two functions will= > be modified and renamed later. >=20 > Signed-off-by: Wenchao Xia > --- > + > +void bdrv_collect_image_info(BlockDriverState *bs, > + ImageInfo *info, > + const char *fmt) > +{ Three arguments here... > + > +void bdrv_collect_snapshots(BlockDriverState *bs , ImageInfo *info); > +void bdrv_collect_image_info(BlockDriverState *bs, > + ImageInfo *info, > + const char *filename, > + const char *fmt); =2E..but four here... > =20 > -static void collect_image_info(BlockDriverState *bs, > - ImageInfo *info, > - const char *filename) =2E..and moved from three arguments here... > info =3D g_new0(ImageInfo, 1); > - collect_image_info(bs, info, filename); > - collect_snapshots(bs, info); > + bdrv_collect_image_info(bs, info, filename, fmt); =2E..and your call site changes from 3 to 4 arguments. How did you compile this? Code motion must NOT make any semantic changes - you should have exactly three arguments, preferably with the same name, and save the addition of a fourth fmt argument until a later patch. Hint - a code motion patch should be easy to inspect with: $ diff -u <(sed -n 's/^-//p' patch) <(sed -n 's/^\+//p' patch) It's okay to have differences (such as 'static void collect_image_info' becoming exported 'void bdrv_collect_image_info', and to see reindentation to line up to the new function name), but the differences should be trivially correct, and not a change between number of parameter= s. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2OPJAVGVHCIVSPEUQIXLA 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/ iQEcBAEBCAAGBQJROmB0AAoJEKeha0olJ0NqiEgIAKu/lDILwX0CoedwWFHMJ36h Xdn2oZFcIoD7E+anoXyTnGdla7Qn2M6JIzDeGlwqwin7UOejRFy9WgtTT5mOMrIa 8H89/drY1WDj2gFSQd1bsbfZYiFMMIqxawTjco9MRz88rrpFLRFkYohIXzU5cy8C hSW06G+rDDm42UFvzdBg03AbNIH2epawC6MZCwwEQGCm7KLcMA1QSsZTlZlmB6JI NPyT05LZ/nc03YVfXMGDRfnj1xt/gELgM0w8uZqDCYTlSIw1naUVVBXZNVAjoA0l 6vk5b0lI8MydJiRWF8T4J+m4DInoB2a9NIF28XDF3TlaP154r0r838rvpvASG2M= =v4d2 -----END PGP SIGNATURE----- ------enig2OPJAVGVHCIVSPEUQIXLA--