[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 19/22] block: Remove bdrv_states
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v2 19/22] block: Remove bdrv_states |
Date: |
Mon, 9 Feb 2015 13:38:41 -0500 |
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 | 21 +--------------------
include/block/block.h | 1 -
include/block/block_int.h | 2 --
3 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/block.c b/block.c
index 94eb4e0..cbe333d 100644
--- a/block.c
+++ b/block.c
@@ -88,9 +88,6 @@ static void coroutine_fn bdrv_co_do_rw(void *opaque);
static int coroutine_fn bdrv_co_do_write_zeroes(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags);
-static QTAILQ_HEAD(, BlockDriverState) bdrv_states =
- QTAILQ_HEAD_INITIALIZER(bdrv_states);
-
static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states =
QTAILQ_HEAD_INITIALIZER(graph_bdrv_states);
@@ -360,10 +357,7 @@ void bdrv_register(BlockDriver *bdrv)
BlockDriverState *bdrv_new_root(void)
{
- BlockDriverState *bs = bdrv_new();
-
- QTAILQ_INSERT_TAIL(&bdrv_states, bs, device_list);
- return bs;
+ return bdrv_new();
}
BlockDriverState *bdrv_new(void)
@@ -1982,17 +1976,6 @@ void bdrv_drain(BlockDriverState *bs)
Also, NULL terminate the device_name to prevent double remove */
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);
}
@@ -2033,8 +2016,6 @@ static void bdrv_move_feature_fields(BlockDriverState
*bs_dest,
/* job */
bs_dest->job = bs_src->job;
- /* keep the same entry in bdrv_states */
- bs_dest->device_list = bs_src->device_list;
bs_dest->blk = bs_src->blk;
memcpy(bs_dest->op_blockers, bs_src->op_blockers,
diff --git a/include/block/block.h b/include/block/block.h
index 2df5bc5..84a90b6 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -361,7 +361,6 @@ BlockDriverState *bdrv_lookup_bs(const char *device,
Error **errp);
bool bdrv_chain_contains(BlockDriverState *top, BlockDriverState *base);
BlockDriverState *bdrv_next_node(BlockDriverState *bs);
-BlockDriverState *bdrv_next(BlockDriverState *bs);
int bdrv_is_encrypted(BlockDriverState *bs);
int bdrv_key_required(BlockDriverState *bs);
int bdrv_set_key(BlockDriverState *bs, const char *key);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 49d4fdd..2e9e3e3 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -380,8 +380,6 @@ struct BlockDriverState {
char node_name[32];
/* element of the list of named nodes building the graph */
QTAILQ_ENTRY(BlockDriverState) node_list;
- /* element of the list of "drives" the guest sees */
- QTAILQ_ENTRY(BlockDriverState) device_list;
QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps;
int refcnt;
--
2.1.0
- [Qemu-devel] [PATCH v2 10/22] block: Make bdrv_close() static, (continued)
- [Qemu-devel] [PATCH v2 10/22] block: Make bdrv_close() static, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 07/22] block: Add bdrv_close_all() handlers, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 06/22] block: Add bdrv_close_all() notifiers, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 11/22] block: Add blk_name_taken(), Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 14/22] block: Use BlockBackend more, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 12/22] block: Add blk_next_inserted(), Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 13/22] block: Add blk_commit_all() and blk_invalidate_cache_all(), Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 17/22] block: Make bdrv_drain_one() public, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 15/22] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 18/22] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 19/22] block: Remove bdrv_states,
Max Reitz <=
- [Qemu-devel] [PATCH v2 20/22] blockdev: Keep track of monitor-owned BDS, Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 16/22] blockdev: Remove blk_hide_on_behalf_of_do_drive_del(), Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 21/22] block: Strip down bdrv_close_all(), Max Reitz, 2015/02/09
- [Qemu-devel] [PATCH v2 22/22] iotests: Add test for multiple BB on BDS tree, Max Reitz, 2015/02/09
- Re: [Qemu-devel] [PATCH v2 00/22] block: Rework bdrv_close_all(), Paolo Bonzini, 2015/02/10