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: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c
Date: Sat, 09 Mar 2013 12:20:43 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

于 2013-3-9 6:04, Eric Blake 写道:
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.


  My bad, I was dizzy in rebasing the patches, will correct it.

--
Best Regards

Wenchao Xia




reply via email to

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