[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V11 13/17] block: dump to buffer for bdrv_snapsh
From: |
Wenchao Xia |
Subject: |
Re: [Qemu-devel] [PATCH V11 13/17] block: dump to buffer for bdrv_snapshot_dump() and bdrv_image_info_dump() |
Date: |
Thu, 11 Apr 2013 14:35:21 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
>>
>> -void bdrv_image_info_dump(ImageInfo *info)
>> +void bdrv_image_info_dump(GString *buf, ImageInfo *info)
>> {
>> char size_buf[128], dsize_buf[128];
>> if (!info->has_actual_size) {
>> @@ -370,43 +369,48 @@ void bdrv_image_info_dump(ImageInfo *info)
>
> I don't like this change, because it introduces buffering for no
> discernible reason. Unless you can show me one, I'd like you to keep
> printing directly.
>
HMP code later need to call this function, and then print buf to
monitor console, which is the goal of this patch.
>> info->actual_size);
>> }
>>
>> static gboolean str_equal_func(gconstpointer a, gconstpointer b)
>> diff --git a/savevm.c b/savevm.c
>> index e4e0008..ce0bbe1 100644
>> --- a/savevm.c
>> +++ b/savevm.c
>> @@ -2466,7 +2466,7 @@ void do_info_snapshots(Monitor *mon, const QDict
>> *qdict)
>> int nb_sns, i, ret, available;
>> int total;
>> int *available_snapshots;
>> - char buf[256];
>> + GString *buf = NULL;
>
> Useless initialization. But if you keep bdrv_snapshot_dump() printing,
> it all goes away.
>
will remove.
--
Best Regards
Wenchao Xia
- Re: [Qemu-devel] [PATCH V11 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block, (continued)
Re: [Qemu-devel] [PATCH V11 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block, Markus Armbruster, 2013/04/10
[Qemu-devel] [PATCH V11 13/17] block: dump to buffer for bdrv_snapshot_dump() and bdrv_image_info_dump(), Wenchao Xia, 2013/04/02
[Qemu-devel] [PATCH V11 16/17] hmp: show ImageInfo in 'info block', Wenchao Xia, 2013/04/02
[Qemu-devel] [PATCH V11 15/17] hmp: switch snapshot info function to qmp based one, Wenchao Xia, 2013/04/02
[Qemu-devel] [PATCH V11 17/17] hmp: add parameters device and -v for info block, Wenchao Xia, 2013/04/02
[Qemu-devel] [PATCH V11 14/17] hmp: add function hmp_info_snapshots(), Wenchao Xia, 2013/04/02
Re: [Qemu-devel] [PATCH V11 00/17] qmp/hmp interfaces for internal snapshot info, Wenchao Xia, 2013/04/07
Re: [Qemu-devel] [PATCH V11 00/17] qmp/hmp interfaces for internal snapshot info, Kevin Wolf, 2013/04/08
Re: [Qemu-devel] [PATCH V11 00/17] qmp/hmp interfaces for internal snapshot info, Stefan Hajnoczi, 2013/04/08