From: Roman Kagan Date: Wed, 26 Apr 2017 14:18:01 +0000 (+0300) Subject: blockcmd: accept only disks and CD-ROMs X-Git-Tag: rel-1.11.0~47 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=177aecfcf4161c53f503782e68608284b198c0f9;p=seabios.git blockcmd: accept only disks and CD-ROMs 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 --- diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c index f147100..5ad128e 100644 --- a/src/hw/blockcmd.c +++ b/src/hw/blockcmd.c @@ -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);