From 382155536cdbffb9ea621f61773109594626ba01 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 26 Nov 2009 15:34:12 +0100 Subject: scsi-disk: restruct emulation: GET_CONFIGURATION Move GET_CONFIGURATION emulation from scsi_send_command() to scsi_disk_emulate_command(). Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name(). Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/scsi-disk.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hw/scsi-disk.c') diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 6ba8f85cde..4a3e6fe105 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -749,6 +749,13 @@ static int scsi_disk_emulate_command(SCSIRequest *req, uint8_t *outbuf) case SYNCHRONIZE_CACHE: bdrv_flush(bdrv); break; + case GET_CONFIGURATION: + memset(outbuf, 0, 8); + /* ??? This should probably return much more information. For now + just return the basic header indicating the CD-ROM profile. */ + outbuf[7] = 8; // CD-ROM + buflen = 8; + break; default: goto illegal_request; } @@ -865,6 +872,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, case READ_CAPACITY: case SYNCHRONIZE_CACHE: case READ_TOC: + case GET_CONFIGURATION: rc = scsi_disk_emulate_command(&r->req, outbuf); if (rc > 0) { r->iov.iov_len = rc; @@ -893,14 +901,6 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, r->sector_count = len * s->cluster_size; is_write = 1; break; - case 0x46: - DPRINTF("Get Configuration (rt %d, maxlen %d)\n", buf[1] & 3, len); - memset(outbuf, 0, 8); - /* ??? This should probably return much more information. For now - just return the basic header indicating the CD-ROM profile. */ - outbuf[7] = 8; // CD-ROM - r->iov.iov_len = 8; - break; case 0x9e: /* Service Action In subcommands. */ if ((buf[1] & 31) == 0x10) { -- cgit v1.2.3