From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgDNd-00012H-Va for qemu-devel@nongnu.org; Sat, 25 May 2013 08:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgDNc-0007JG-Bd for qemu-devel@nongnu.org; Sat, 25 May 2013 08:15:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgDNc-0007J0-3p for qemu-devel@nongnu.org; Sat, 25 May 2013 08:15:24 -0400 Message-ID: <51A0AB55.1040204@redhat.com> Date: Sat, 25 May 2013 06:15:17 -0600 From: Eric Blake MIME-Version: 1.0 References: <1369451385-23452-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1369451385-23452-5-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1369451385-23452-5-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2SJLTJJMTEAAMMHBAKHVP" Subject: Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, phrdina@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2SJLTJJMTEAAMMHBAKHVP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/24/2013 09:09 PM, Wenchao Xia wrote: > bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer= now, > some internal buffers are still used for format control, which have no > chance to be truncated. As a result, these two functions have no more i= ssue > of truncation, and they can be used by both qemu and qemu-img with corr= ect > parameter specified. >=20 > Signed-off-by: Wenchao Xia > --- > block/qapi.c | 66 +++++++++++++++++++++++++++---------------= ------- > include/block/qapi.h | 6 +++- > qemu-img.c | 9 ++++--- > savevm.c | 7 +++-- > 4 files changed, 49 insertions(+), 39 deletions(-) > -char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn= ) > +void bdrv_snapshot_dump(fprintf_function func_fprintf, void *f, > + QEMUSnapshotInfo *sn) > { > char buf1[128], date_buf[128], clock_buf[128]; > + func_fprintf(f, > + "%-10s%-20s%7s%20s%15s", > + sn->id_str, sn->name, > + get_human_readable_size(buf1, sizeof(buf1), > + sn->vm_state_size), > + date_buf, > + clock_buf); Now that 'buf' is no longer in scope, it might be nice to rename 'buf1' to something more meaningful; maybe size_buf to go along with the other two named buffers. But the choice of naming doesn't impact the correctness, so Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2SJLTJJMTEAAMMHBAKHVP 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/ iQEcBAEBCAAGBQJRoKtVAAoJEKeha0olJ0NqUJMH/jdjTXedPYPGzwT7u0NmO8FU 0jzJhCZFjFGM/zJvYKq5+qtduD5jV1wpm7eEHPKdnFEFwaiydOqhrINDL9cM9DyJ QNpCucyfsk+qcuAS8y4xWIS2OjfwCHyH4yaqkJ7kSMwejM1Uss78HcSqDxh1cegR vmJah1i42ePSOSjUE3Ebla8YD7VdgVLlWbHcFlLeQc5lA0clEd4WBjSrsx5kun9B KtOYIkq+OoYqIVvSIkYRLlF0SCtBRQ3BK9DdkZm3mLG+H+y3KO3SKIzm84IcVrid +h9/FO8mg1ERIhN+57OPreMY8ywmXcy7VN8XU6epPZ5IzJLia0NSMd6z1qixS00= =s6E8 -----END PGP SIGNATURE----- ------enig2SJLTJJMTEAAMMHBAKHVP--