]> Git Repo - qemu.git/blobdiff - block.c
block: Assume raw for drives without media
[qemu.git] / block.c
diff --git a/block.c b/block.c
index 9c43332f4f4f33a134722d39f52858cc0d8239cc..ecd98675a5aa923b5d54c73c9a7d985628e044b1 100644 (file)
--- a/block.c
+++ b/block.c
@@ -331,8 +331,8 @@ static BlockDriver *find_image_format(const char *filename)
     if (ret < 0)
         return NULL;
 
-    /* Return the raw BlockDriver * to scsi-generic devices */
-    if (bs->sg) {
+    /* Return the raw BlockDriver * to scsi-generic devices or empty drives */
+    if (bs->sg || !bdrv_is_inserted(bs)) {
         bdrv_delete(bs);
         return bdrv_find_format("raw");
     }
This page took 0.019316 seconds and 4 git commands to generate.