diff options
author | Anton Kuchin <antonkuchin@yandex-team.ru> | 2019-05-07 11:12:56 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-05-10 16:45:40 +0200 |
commit | 30c321f97fa5898a5ad71070af6ce271fbdba347 (patch) | |
tree | c85242990bfba8652fed619372996f7957478c4f /block.c | |
parent | efb4f3b62c69383a7308d7b739a3193e7c0ccae8 (diff) |
block: remove bs from lists before closing
Close involves flush that can be performed asynchronously and bs
must be protected from being referenced before it is deleted.
Signed-off-by: Anton Kuchin <antonkuchin@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4082,14 +4082,14 @@ static void bdrv_delete(BlockDriverState *bs) assert(bdrv_op_blocker_is_empty(bs)); assert(!bs->refcnt); - bdrv_close(bs); - /* remove from list, if necessary */ if (bs->node_name[0] != '\0') { QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list); } QTAILQ_REMOVE(&all_bdrv_states, bs, bs_list); + bdrv_close(bs); + g_free(bs); } |