aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-05-25 11:09:45 +0800
committerKevin Wolf <kwolf@redhat.com>2013-06-04 13:56:30 +0200
commit5b91704469c0f801e0219f26458356872c4145ab (patch)
tree604c6165a9af9a58c320b5480192b48909de3f96 /qemu-img.c
parentf364ec65b56b69c55b674cb6560aa1fbbea9e013 (diff)
downloadqemu-5b91704469c0f801e0219f26458356872c4145ab.zip
qemu-5b91704469c0f801e0219f26458356872c4145ab.tar.gz
qemu-5b91704469c0f801e0219f26458356872c4145ab.tar.bz2
block: dump snapshot and image info to specified output
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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 5d1e480..82c7977 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1554,16 +1554,17 @@ static void dump_snapshots(BlockDriverState *bs)
{
QEMUSnapshotInfo *sn_tab, *sn;
int nb_sns, i;
- char buf[256];
nb_sns = bdrv_snapshot_list(bs, &sn_tab);
if (nb_sns <= 0)
return;
printf("Snapshot list:\n");
- printf("%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));
+ bdrv_snapshot_dump(fprintf, stdout, NULL);
+ printf("\n");
for(i = 0; i < nb_sns; i++) {
sn = &sn_tab[i];
- printf("%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn));
+ bdrv_snapshot_dump(fprintf, stdout, sn);
+ printf("\n");
}
g_free(sn_tab);
}
@@ -1613,7 +1614,7 @@ static void dump_human_image_info_list(ImageInfoList *list)
}
delim = true;
- bdrv_image_info_dump(elem->value);
+ bdrv_image_info_dump(fprintf, stdout, elem->value);
}
}