From: Eric Blake <eblake@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, phrdina@redhat.com, stefanha@gmail.com,
qemu-devel@nongnu.org, lcapitulino@redhat.com,
pbonzini@redhat.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output
Date: Sat, 25 May 2013 06:15:17 -0600 [thread overview]
Message-ID: <51A0AB55.1040204@redhat.com> (raw)
In-Reply-To: <1369451385-23452-5-git-send-email-xiawenc@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]
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 issue
> of truncation, and they can be used by both qemu and qemu-img with correct
> parameter specified.
>
> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
> ---
> 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 <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-05-25 12:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-25 3:09 [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer Wenchao Xia
2013-05-25 3:09 ` [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable Wenchao Xia
2013-05-27 15:18 ` Kevin Wolf
2013-05-28 2:20 ` Wenchao Xia
2013-05-27 15:25 ` Kevin Wolf
2013-05-28 2:24 ` Wenchao Xia
2013-05-28 7:46 ` Stefan Hajnoczi
2013-05-29 7:54 ` Wenchao Xia
2013-05-29 9:09 ` Stefan Hajnoczi
2013-05-29 9:45 ` Wenchao Xia
2013-05-25 3:09 ` [Qemu-devel] [PATCH V3 2/4] block: move snapshot code in block.c to block/snapshot.c Wenchao Xia
2013-05-25 12:17 ` Eric Blake
2013-05-25 3:09 ` [Qemu-devel] [PATCH V3 3/4] block: move qmp and info dump related code to block/qapi.c Wenchao Xia
2013-05-25 3:09 ` [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output Wenchao Xia
2013-05-25 12:15 ` Eric Blake [this message]
2013-05-27 15:02 ` Luiz Capitulino
2013-05-27 15:40 ` Kevin Wolf
2013-05-27 15:55 ` Luiz Capitulino
2013-05-28 2:09 ` Wenchao Xia
2013-05-27 15:41 ` [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer Kevin Wolf
2013-05-30 2:41 ` Wenchao Xia
2013-05-31 13:04 ` Wenchao Xia
2013-05-31 13:19 ` Luiz Capitulino
2013-06-03 2:22 ` Wenchao Xia
2013-06-04 12:46 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A0AB55.1040204@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=xiawenc@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).