Patchwork [1/7] SCSI: Fix Standard INQUIRY data

login
register
mail settings
Submitter Jan Kiszka
Date Nov. 19, 2009, 10:07 a.m.
Message ID <20091119100712.16666.45088.stgit@mchn012c.ww002.siemens.net>
Download mbox | patch
Permalink /patch/38821/
State New
Headers show

Comments

Jan Kiszka - Nov. 19, 2009, 10:07 a.m.
From: Laszlo Ast <laszlo.ast@siemens-enterprise.com>

Vendor identification, product identification and product revision level
should be padded with spaces without a terminating NULL character, see
SCSI-2 standard, 8.2.5.1 Standard INQUIRY data.

Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 hw/scsi-disk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index a92b62f..f3f4fda 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -593,12 +593,12 @@  static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
 	} else if (bdrv_get_type_hint(s->dinfo->bdrv) == BDRV_TYPE_CDROM) {
 	    outbuf[0] = 5;
             outbuf[1] = 0x80;
-	    memcpy(&outbuf[16], "QEMU CD-ROM    ", 16);
+	    memcpy(&outbuf[16], "QEMU CD-ROM     ", 16);
 	} else {
 	    outbuf[0] = 0;
-	    memcpy(&outbuf[16], "QEMU HARDDISK  ", 16);
+	    memcpy(&outbuf[16], "QEMU HARDDISK   ", 16);
 	}
-	memcpy(&outbuf[8], "QEMU   ", 8);
+	memcpy(&outbuf[8], "QEMU    ", 8);
         memcpy(&outbuf[32], QEMU_VERSION, 4);
         /* Identify device as SCSI-3 rev 1.
            Some later commands are also implemented. */