aboutsummaryrefslogtreecommitdiff
path: root/savevm.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 /savevm.c
parentf364ec65b56b69c55b674cb6560aa1fbbea9e013 (diff)
downloadqemu-arm-5b91704469c0f801e0219f26458356872c4145ab.tar.gz
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 'savevm.c')
-rw-r--r--savevm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/savevm.c b/savevm.c
index a886514c00..2ce439f7f4 100644
--- a/savevm.c
+++ b/savevm.c
@@ -2540,7 +2540,6 @@ void do_info_snapshots(Monitor *mon, const QDict *qdict)
int nb_sns, i, ret, available;
int total;
int *available_snapshots;
- char buf[256];
bs = find_vmstate_bs();
if (!bs) {
@@ -2583,10 +2582,12 @@ void do_info_snapshots(Monitor *mon, const QDict *qdict)
}
if (total > 0) {
- monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));
+ bdrv_snapshot_dump((fprintf_function)monitor_printf, mon, NULL);
+ monitor_printf(mon, "\n");
for (i = 0; i < total; i++) {
sn = &sn_tab[available_snapshots[i]];
- monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn));
+ bdrv_snapshot_dump((fprintf_function)monitor_printf, mon, sn);
+ monitor_printf(mon, "\n");
}
} else {
monitor_printf(mon, "There is no suitable snapshot available\n");