[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to s
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, (continued)
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Kevin Wolf, 2013/05/27
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Wenchao Xia, 2013/05/27
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Stefan Hajnoczi, 2013/05/28
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Wenchao Xia, 2013/05/29
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Stefan Hajnoczi, 2013/05/29
- Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable, Wenchao Xia, 2013/05/29
[Qemu-devel] [PATCH V3 2/4] block: move snapshot code in block.c to block/snapshot.c, Wenchao Xia, 2013/05/24
[Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output, Wenchao Xia, 2013/05/24
[Qemu-devel] [PATCH V3 3/4] block: move qmp and info dump related code to block/qapi.c, Wenchao Xia, 2013/05/24
Re: [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer, Kevin Wolf, 2013/05/27