diff mbox

[1/2,block] : Fix scsi-generic breakage in find_image_format()

Message ID 1273930252-12673-1-git-send-email-nab@linux-iscsi.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas A. Bellinger May 15, 2010, 1:30 p.m. UTC
None
diff mbox

Patch

diff --git a/block.c b/block.c
index 48305b7..02a22f6 100644
--- a/block.c
+++ b/block.c
@@ -332,6 +332,13 @@  static BlockDriver *find_image_format(const char *filename)
     ret = bdrv_file_open(&bs, filename, 0);
     if (ret < 0)
         return NULL;
+    /*
+     * For scsi-generic we skip the read and return *drv from
+     * find_protocol().
+     */
+    if (bs->sg)
+	return drv;
+
     ret = bdrv_pread(bs, 0, buf, sizeof(buf));
     bdrv_delete(bs);
     if (ret < 0) {