mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
block/qapi: Clean up how we print to monitor or stdout
bdrv_snapshot_dump(), bdrv_image_info_specific_dump(), bdrv_image_info_dump() and their helpers take an fprintf()-like callback and a FILE * to pass to it. hmp.c passes monitor_printf() cast to fprintf_function and the current monitor cast to FILE *. qemu-img.c and qemu-io-cmds.c pass fprintf and stdout. The type-punning is technically undefined behaviour, but works in practice. Clean up: drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-8-armbru@redhat.com>
This commit is contained in:
parent
ac7ff4cf5f
commit
e1ce7d747b
5 changed files with 67 additions and 83 deletions
|
@ -2483,11 +2483,11 @@ static void dump_snapshots(BlockDriverState *bs)
|
|||
if (nb_sns <= 0)
|
||||
return;
|
||||
printf("Snapshot list:\n");
|
||||
bdrv_snapshot_dump(fprintf, stdout, NULL);
|
||||
bdrv_snapshot_dump(NULL);
|
||||
printf("\n");
|
||||
for(i = 0; i < nb_sns; i++) {
|
||||
sn = &sn_tab[i];
|
||||
bdrv_snapshot_dump(fprintf, stdout, sn);
|
||||
bdrv_snapshot_dump(sn);
|
||||
printf("\n");
|
||||
}
|
||||
g_free(sn_tab);
|
||||
|
@ -2536,7 +2536,7 @@ static void dump_human_image_info_list(ImageInfoList *list)
|
|||
}
|
||||
delim = true;
|
||||
|
||||
bdrv_image_info_dump(fprintf, stdout, elem->value);
|
||||
bdrv_image_info_dump(elem->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue