]> xenbits.xensource.com Git - seabios.git/commitdiff
scsi: fix detection of QEMU
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Aug 2012 16:22:44 +0000 (18:22 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 4 Aug 2012 15:02:29 +0000 (11:02 -0400)
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@redhat.com>
src/blockcmd.c

index 95406c657137773266607486475807a0368b4114..43656500e4927e180754769a269453d343a851dd 100644 (file)
@@ -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) {