diff mbox

[Qemu-devel,0/2] Fix scsi-generic breakage in upstream qemu-kvm.git

Message ID 1274975788.16907.38.camel@haakon2.linux-iscsi.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas A. Bellinger May 27, 2010, 3:56 p.m. UTC
None
diff mbox

Patch

diff --git a/block.c b/block.c
index 7a379dc..88dbc00 100644
--- a/block.c
+++ b/block.c
@@ -334,8 +334,10 @@  static BlockDriver *find_image_format(const char *filename)
         return NULL;

     /* Return the raw BlockDriver * to scsi-generic devices */
-    if (bs->sg)
+    if (bs->sg) {
+        bdrv_delete(bs); 
         return bdrv_find_format("raw");
+    }

     ret = bdrv_pread(bs, 0, buf, sizeof(buf));
     bdrv_delete(bs);