[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and co
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c |
Date: |
Fri, 08 Mar 2013 15:04:36 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 |
On 03/06/2013 11:07 PM, Wenchao Xia wrote:
> This patch is just for making review easier, those two functions will
> be modified and renamed later.
>
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
> +
> +void bdrv_collect_image_info(BlockDriverState *bs,
> + ImageInfo *info,
> + const char *fmt)
> +{
Three arguments here...
> +
> +void bdrv_collect_snapshots(BlockDriverState *bs , ImageInfo *info);
> +void bdrv_collect_image_info(BlockDriverState *bs,
> + ImageInfo *info,
> + const char *filename,
> + const char *fmt);
...but four here...
>
> -static void collect_image_info(BlockDriverState *bs,
> - ImageInfo *info,
> - const char *filename)
...and moved from three arguments here...
> info = g_new0(ImageInfo, 1);
> - collect_image_info(bs, info, filename);
> - collect_snapshots(bs, info);
> + bdrv_collect_image_info(bs, info, filename, fmt);
...and your call site changes from 3 to 4 arguments.
How did you compile this? Code motion must NOT make any semantic
changes - you should have exactly three arguments, preferably with the
same name, and save the addition of a fourth fmt argument until a later
patch.
Hint - a code motion patch should be easy to inspect with:
$ diff -u <(sed -n 's/^-//p' patch) <(sed -n 's/^\+//p' patch)
It's okay to have differences (such as 'static void collect_image_info'
becoming exported 'void bdrv_collect_image_info', and to see
reindentation to line up to the new function name), but the differences
should be trivially correct, and not a change between number of parameters.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH V8 03/20] block: move bdrv_snapshot_find() to block/snapshot.c, (continued)
- [Qemu-devel] [PATCH V8 03/20] block: move bdrv_snapshot_find() to block/snapshot.c, Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 04/20] block: distinguish id and name in bdrv_find_snapshot(), Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 07/20] block: add snapshot info query function bdrv_query_snapshot_info_list(), Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 05/20] qemu-img: remove unused parameter in collect_image_info(), Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c, Wenchao Xia, 2013/03/07
- Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c,
Eric Blake <=
- [Qemu-devel] [PATCH V8 08/20] block: add filter for vm snapshot in bdrv_query_snapshot_info_list(), Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 09/20] block: add image info query function bdrv_query_image_info(), Wenchao Xia, 2013/03/07
- [Qemu-devel] [PATCH V8 10/20] qmp: add interface query-snapshots, Wenchao Xia, 2013/03/07