qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 8/8] block: Remove bdrv_states


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH v2 8/8] block: Remove bdrv_states
Date: Wed, 25 Nov 2015 14:50:02 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 10.11.2015 um 04:27 hat Max Reitz geschrieben:
> Every entry in this list should be a root BDS and as such either be
> anchored to a BlockBackend or be owned by the monitor.
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  block.c                   | 30 +-----------------------------
>  blockdev.c                |  8 --------
>  include/block/block.h     |  1 -
>  include/block/block_int.h |  4 ----
>  4 files changed, 1 insertion(+), 42 deletions(-)

>  void bdrv_make_anon(BlockDriverState *bs)
>  {
> -    /*
> -     * Take care to remove bs from bdrv_states only when it's actually
> -     * in it.  Note that bs->device_list.tqe_prev is initially null,
> -     * and gets set to non-null by QTAILQ_INSERT_TAIL().  Establish
> -     * the useful invariant "bs in bdrv_states iff bs->tqe_prev" by
> -     * resetting it to null on remove.
> -     */
> -    if (bs->device_list.tqe_prev) {
> -        QTAILQ_REMOVE(&bdrv_states, bs, device_list);
> -        bs->device_list.tqe_prev = NULL;
> -    }
>      if (bs->node_name[0] != '\0') {
>          QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list);
>      }

bdrv_make_anon() has only a single user at this point and the remaining
part after this patch is so small that we could consider inlining it.

Kevin



reply via email to

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