qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]