qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4179] unlink the bs from bdrv-list upon bdrv_delete(bs)
@ 2008-04-08 19:51 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-04-08 19:51 UTC (permalink / raw)
  To: qemu-devel

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);
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-08 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 19:51 [Qemu-devel] [4179] unlink the bs from bdrv-list upon bdrv_delete(bs) Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).