From 34c6f05032edb8c095426e0308b4a131a9265b44 Mon Sep 17 00:00:00 2001 From: aurel32 Date: Tue, 8 Apr 2008 19:51:21 +0000 Subject: unlink the bs from bdrv-list upon bdrv_delete(bs) (Uri Lublin) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4179 c046a42c-6fe2-441c-8c8c-71466251a162 --- block.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 07309541f3..bd647a6f47 100644 --- a/block.c +++ b/block.c @@ -452,7 +452,14 @@ void bdrv_close(BlockDriverState *bs) void bdrv_delete(BlockDriverState *bs) { - /* XXX: remove the driver list */ + BlockDriverState **pbs; + + pbs = &bdrv_first; + while (*pbs != bs && *pbs != NULL) + pbs = &(*pbs)->next; + if (*pbs == bs) + *pbs = bs->next; + bdrv_close(bs); qemu_free(bs); } -- cgit v1.2.3