From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDfRC-00074f-65 for qemu-devel@nongnu.org; Thu, 26 Nov 2009 09:35:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDfR6-0006xJ-Fc for qemu-devel@nongnu.org; Thu, 26 Nov 2009 09:35:10 -0500 Received: from [199.232.76.173] (port=56179 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDfR3-0006tj-IH for qemu-devel@nongnu.org; Thu, 26 Nov 2009 09:35:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46123) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDfR2-0000JC-UV for qemu-devel@nongnu.org; Thu, 26 Nov 2009 09:35:05 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAQEZ4jR008456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 26 Nov 2009 09:35:04 -0500 From: Gerd Hoffmann Date: Thu, 26 Nov 2009 15:34:12 +0100 Message-Id: <1259246056-5389-27-git-send-email-kraxel@redhat.com> In-Reply-To: <1259246056-5389-1-git-send-email-kraxel@redhat.com> References: <1259246056-5389-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 26/30] scsi-disk: restruct emulation: GET_CONFIGURATION List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 --- hw/scsi-bus.c | 1 + hw/scsi-defs.h | 1 + hw/scsi-disk.c | 16 ++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index e362671..09b6fa9 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -440,6 +440,7 @@ static const char *scsi_command_name(uint8_t cmd) [ REWIND ] = "REWIND", [ REPORT_DENSITY_SUPPORT ] = "REPORT_DENSITY_SUPPORT", + [ GET_CONFIGURATION ] = "GET_CONFIGURATION", [ LOAD_UNLOAD ] = "LOAD_UNLOAD", [ SET_CD_SPEED ] = "SET_CD_SPEED", [ BLANK ] = "BLANK", diff --git a/hw/scsi-defs.h b/hw/scsi-defs.h index 1701521..fbcfaa6 100644 --- a/hw/scsi-defs.h +++ b/hw/scsi-defs.h @@ -99,6 +99,7 @@ /* from hw/scsi-generic.c */ #define REWIND 0x01 #define REPORT_DENSITY_SUPPORT 0x44 +#define GET_CONFIGURATION 0x46 #define LOAD_UNLOAD 0xa6 #define SET_CD_SPEED 0xbb #define BLANK 0xa1 diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 6ba8f85..4a3e6fe 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) { -- 1.6.2.5