[SeaBIOS] [PATCH 2/2] scsi: fix detection of QEMU

Paolo Bonzini pbonzini at redhat.com
Thu Aug 2 18:22:44 CEST 2012


The vendor string is null-terminated by the time scsi_init_drive looks
at it, so it is incorrect to pad the memcmp argument with spaces.
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 src/blockcmd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/blockcmd.c b/src/blockcmd.c
index 95406c6..4365650 100644
--- a/src/blockcmd.c
+++ b/src/blockcmd.c
@@ -158,7 +158,7 @@ scsi_init_drive(struct drive_s *drive, const char *s, int prio)
     // but some old USB keys only support a very small subset of SCSI which
     // does not even include the MODE SENSE command!
     //
-    if (! CONFIG_COREBOOT && memcmp(vendor, "QEMU    ", 8) == 0) {
+    if (! CONFIG_COREBOOT && memcmp(vendor, "QEMU", 5) == 0) {
         struct cdbres_mode_sense_geom geomdata;
         ret = cdb_mode_sense_geom(&dop, &geomdata);
         if (ret == 0) {
-- 
1.7.10.4




More information about the SeaBIOS mailing list