qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdr


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdrv_query_info() to block/qapi.c
Date: Sat, 30 Mar 2013 20:32:07 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

于 2013-3-30 4:10, Eric Blake 写道:
On 03/22/2013 08:19 AM, Wenchao Xia wrote:
   This is a code move patch, except in qmp_query_block bdrv_next(bs)
is used instead of direct traverse of global array 'bdrv_states'.

Mixing code motion and a code change isn't always the best, but at least
you were honest about it.  I don't know how easy it would be to split
this into two patches for straight code motion.

  It can't be split since build fail with original code, bdrv_states
is a static global variable in block.c.

   This patch also fix code style error reported by check script.

Signed-off-by: Wenchao Xia <address@hidden>
---
  block.c               |   76 ------------------------------------------------
  block/qapi.c          |   77 +++++++++++++++++++++++++++++++++++++++++++++++++
  include/block/block.h |    1 -
  include/block/qapi.h  |    1 +
  4 files changed, 78 insertions(+), 77 deletions(-)

At any rate,

Reviewed-by: Eric Blake <address@hidden>

-BlockInfoList *qmp_query_block(Error **errp)
-{
-    BlockInfoList *head = NULL, **p_next = &head;
-    BlockDriverState *bs;
-
-    QTAILQ_FOREACH(bs, &bdrv_states, list) {

+BlockInfoList *qmp_query_block(Error **errp)
+{
+    BlockInfoList *head = NULL, **p_next = &head;
+    BlockDriverState *bs = NULL;
+
+    while ((bs = bdrv_next(bs))) {

This is the tweak you made.



--
Best Regards

Wenchao Xia




reply via email to

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