From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULfd2-0004gN-VN for qemu-devel@nongnu.org; Fri, 29 Mar 2013 16:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULfcx-0007UI-79 for qemu-devel@nongnu.org; Fri, 29 Mar 2013 16:10:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULfcw-0007Tz-Tp for qemu-devel@nongnu.org; Fri, 29 Mar 2013 16:10:19 -0400 Message-ID: <5155F51F.4050704@redhat.com> Date: Fri, 29 Mar 2013 14:10:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1363961953-13561-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1363961953-13561-9-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1363961953-13561-9-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2XOSMVXVVXGJNEGUMWVFK" Subject: Re: [Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdrv_query_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, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XOSMVXVVXGJNEGUMWVFK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/22/2013 08:19 AM, Wenchao Xia wrote: > This is a code move patch, except in qmp_query_block bdrv_next(bs) > is used instead of direct traverse of global array 'bdrv_states'. Mixing code motion and a code change isn't always the best, but at least you were honest about it. I don't know how easy it would be to split this into two patches for straight code motion. > This patch also fix code style error reported by check script. >=20 > Signed-off-by: Wenchao Xia > --- > block.c | 76 -----------------------------------------= ------- > block/qapi.c | 77 +++++++++++++++++++++++++++++++++++++++++= ++++++++ > include/block/block.h | 1 - > include/block/qapi.h | 1 + > 4 files changed, 78 insertions(+), 77 deletions(-) At any rate, Reviewed-by: Eric Blake > -BlockInfoList *qmp_query_block(Error **errp) > -{ > - BlockInfoList *head =3D NULL, **p_next =3D &head; > - BlockDriverState *bs; > - > - QTAILQ_FOREACH(bs, &bdrv_states, list) { > +BlockInfoList *qmp_query_block(Error **errp) > +{ > + BlockInfoList *head =3D NULL, **p_next =3D &head; > + BlockDriverState *bs =3D NULL; > + > + while ((bs =3D bdrv_next(bs))) { This is the tweak you made. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2XOSMVXVVXGJNEGUMWVFK 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/ iQEcBAEBCAAGBQJRVfUfAAoJEKeha0olJ0NqdsMIAKYpP+kHw33U2YQGVSgzPluV xSA7qeOZxeQLuWI1iW2Mb0Ws2AezSqronSoYpKvn96Q22Hrm4uqphJFvQfR7ZB6Y nA7/W7rLGYtMY4hg4k3/Kmt/Mrdd4i+c1ob7uyaJOJzjD4eOJHUUlv4JTrcbh8OE 1/hcGZ9HmGrm0pGmSuvcB191rkZX+i/smBmQguJ6FFMlDCA/yIm7HrdGyaSJGS6w 0jtHTgv6/bIdE1yOhMLbPjXWek0yJoifmgUc6jDNUR/ioJEy+c+Zfsn62cldknlw qBsWBoV7ZsWraKVt+Qu8X6vzXWB8B/mvpVi/1DRgfkqmZ6LLY0Qip9L8vazxIv0= =tIMa -----END PGP SIGNATURE----- ------enig2XOSMVXVVXGJNEGUMWVFK--