提交 e1b5c52e 编写于 作者: S Stefan Hajnoczi

block: ensure bdrv_drain_all() works during bdrv_delete()

In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
so that the device is still seen by bdrv_drain_all() when iterating
bdrv_states.

Cc: qemu-stable@nongnu.org
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 f2020398
......@@ -1606,11 +1606,11 @@ void bdrv_delete(BlockDriverState *bs)
assert(!bs->job);
assert(!bs->in_use);
bdrv_close(bs);
/* remove from list, if necessary */
bdrv_make_anon(bs);
bdrv_close(bs);
g_free(bs);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册