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 > --- > 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 > -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. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org