qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4179] unlink the bs from bdrv-list upon bdrv_delete(bs)


From: Aurelien Jarno
Subject: [Qemu-devel] [4179] unlink the bs from bdrv-list upon bdrv_delete(bs)
Date: Tue, 08 Apr 2008 19:51:21 +0000

Revision: 4179
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4179
Author:   aurel32
Date:     2008-04-08 19:51:21 +0000 (Tue, 08 Apr 2008)

Log Message:
-----------
unlink the bs from bdrv-list upon bdrv_delete(bs)

(Uri Lublin)

Modified Paths:
--------------
    trunk/block.c

Modified: trunk/block.c
===================================================================
--- trunk/block.c       2008-04-08 19:51:13 UTC (rev 4178)
+++ trunk/block.c       2008-04-08 19:51:21 UTC (rev 4179)
@@ -452,7 +452,14 @@
 
 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);
 }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]