]> xenbits.xensource.com Git - seabios.git/commitdiff
blockcmd: accept only disks and CD-ROMs
authorRoman Kagan <rkagan@virtuozzo.com>
Wed, 26 Apr 2017 14:18:01 +0000 (17:18 +0300)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 2 May 2017 23:57:03 +0000 (19:57 -0400)
Luns that report to INQUIRY with a type other than CD-ROM are considered
disks.  This isn't necessarily the case; working with such luns as disks
may lead to unpredictable results.

So bail out if the lun is neither CD-ROM nor disk.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
src/hw/blockcmd.c

index f147100e9883c3f3d7aac18f54ece65fcd8ef0a2..5ad128e52bae132d0e1ee3330ee7549be12e94ef 100644 (file)
@@ -217,6 +217,9 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
         return 0;
     }
 
+    if (pdt != SCSI_TYPE_DISK)
+        return -1;
+
     ret = scsi_is_ready(&dop);
     if (ret) {
         dprintf(1, "scsi_is_ready returned %d\n", ret);