summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-08 19:51:21 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-08 19:51:21 +0000
commit34c6f05032edb8c095426e0308b4a131a9265b44 (patch)
tree403fdd4a4cf0d2afba5b11d23714c235122f2208
parent66a3cc798e2639461ae9c9c7fb42c9896afcc532 (diff)
downloadqemu-34c6f05032edb8c095426e0308b4a131a9265b44.tar.gz
qemu-34c6f05032edb8c095426e0308b4a131a9265b44.tar.bz2
qemu-34c6f05032edb8c095426e0308b4a131a9265b44.zip
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
-rw-r--r--block.c9
1 files changed, 8 insertions, 1 deletions
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);
}