From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1aSZ-0001MM-VP for qemu-devel@nongnu.org; Wed, 25 Nov 2015 08:50:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1aSZ-0006Cd-3e for qemu-devel@nongnu.org; Wed, 25 Nov 2015 08:50:11 -0500 Date: Wed, 25 Nov 2015 14:50:02 +0100 From: Kevin Wolf Message-ID: <20151125135002.GD12581@noname.str.redhat.com> References: <1447126069-6185-1-git-send-email-mreitz@redhat.com> <1447126069-6185-9-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447126069-6185-9-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 8/8] block: Remove bdrv_states List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org 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 > --- > 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