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.
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.