[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots(
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots() |
Date: |
Fri, 29 Mar 2013 17:04:32 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/22/2013 08:19 AM, Wenchao Xia wrote:
> This function will simply call qmp interface qmp_query_snapshots()
> added in last commit and then dump information in monitor console.
> To get snapshot info, Now qemu and qemu-img both call block layer
> function bdrv_query_snapshot_info_list() in their calling path, and
> then they just translate the qmp object got to strings in stdout or
> monitor console.
>
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
> hmp.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> hmp.h | 1 +
> 2 files changed, 43 insertions(+), 0 deletions(-)
>
> diff --git a/hmp.c b/hmp.c
> index b0a861c..c475d65 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -651,6 +651,48 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
> qapi_free_TPMInfoList(info_list);
> }
>
> +/* assume list is valid */
> +static void monitor_dump_snapshotinfolist(Monitor *mon, SnapshotInfoList
> *list)
> +{
> + SnapshotInfoList *elem;
> + char buf[256];
> +
> + monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));
Are you sure that won't ever be truncated? I'm pretty sure that I could
come up with a scenario where I cause bdrv_snapshot_dump() to want to
output more than 256 bytes of details.
--
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 V10 08/17] block: move qmp_query_block() and bdrv_query_info() to block/qapi.c, (continued)
- [Qemu-devel] [PATCH V10 09/17] qmp: add interface query-snapshots, Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 07/17] block: add image info query function bdrv_query_image_info(), Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 10/17] qmp: add recursive member in ImageInfo, Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block, Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots(), Wenchao Xia, 2013/03/22
- Re: [Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots(),
Eric Blake <=
- [Qemu-devel] [PATCH V10 13/17] hmp: switch snapshot info function to qmp based one, Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 14/17] block: move dump_human_image_info() to block/qapi.c, Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 15/17] block: dump to buffer for bdrv_image_info_dump(), Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 16/17] hmp: show ImageInfo in 'info block', Wenchao Xia, 2013/03/22
- [Qemu-devel] [PATCH V10 17/17] hmp: add parameter device and -b for info block, Wenchao Xia, 2013/03/22
- Re: [Qemu-devel] [PATCH V10 00/17] qmp/hmp interfaces for internal snapshot info, Kevin Wolf, 2013/03/28