Re: [Qemu-devel] [PATCH 2/2] block: Convert bdrv_first to QTAILQ

2010-04-10 Thread Stefan Hajnoczi
On Fri, Apr 9, 2010 at 7:17 PM, Stefan Hajnoczi stefa...@gmail.com wrote: I see three options: 1. Leave the search. 2. Modify qemu-queue.h to add a QTAILQ_ON_LIST(elm) macro. 3. Break the QTAILQ abstraction and test tge_prev directly. I see a nicer option: check device_name[0]. Patch v2

Re: [Qemu-devel] [PATCH 2/2] block: Convert bdrv_first to QTAILQ

2010-04-10 Thread Kevin Wolf
Am 10.04.2010 08:04, schrieb Stefan Hajnoczi: On Fri, Apr 9, 2010 at 7:17 PM, Stefan Hajnoczi stefa...@gmail.com wrote: I see three options: 1. Leave the search. 2. Modify qemu-queue.h to add a QTAILQ_ON_LIST(elm) macro. 3. Break the QTAILQ abstraction and test tge_prev directly. I see a

Re: [Qemu-devel] [PATCH 2/2] block: Convert bdrv_first to QTAILQ

2010-04-09 Thread Kevin Wolf
Am 09.04.2010 16:22, schrieb Stefan Hajnoczi: Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- block.c | 44 +++- block_int.h |3 ++- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/block.c b/block.c index

Re: [Qemu-devel] [PATCH 2/2] block: Convert bdrv_first to QTAILQ

2010-04-09 Thread Stefan Hajnoczi
On Fri, Apr 9, 2010 at 5:47 PM, Kevin Wolf kw...@redhat.com wrote: @@ -545,13 +542,15 @@ void bdrv_close(BlockDriverState *bs)  void bdrv_delete(BlockDriverState *bs)  { -    BlockDriverState **pbs; +    BlockDriverState *bs1; -    pbs = bdrv_first; -    while (*pbs != bs *pbs != NULL)