aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-11-26 15:33:58 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:37 -0600
commit37659e510483fd8758424356b76209124ccfd98c (patch)
tree087b227ecc8712498a12938259331570eb943853 /hw/scsi-disk.c
parent97a064356704af1756270b1d56dea2690ae015de (diff)
scsi: move sense to SCSIDevice, create SCSISense struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 4e929104bc..2eac400839 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -59,7 +59,6 @@ struct SCSIDiskState
This is the number of 512 byte blocks in a single scsi sector. */
int cluster_size;
uint64_t max_lba;
- int sense;
char drive_serial_str[21];
QEMUBH *bh;
};
@@ -93,7 +92,7 @@ static void scsi_command_complete(SCSIDiskReq *r, int status, int sense)
uint32_t tag;
DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",
r->req.tag, status, sense);
- s->sense = sense;
+ scsi_dev_set_sense(&s->qdev, sense);
tag = r->req.tag;
r->req.bus->complete(r->req.bus, SCSI_REASON_DONE, tag, status);
scsi_remove_request(r);
@@ -394,7 +393,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
goto fail;
memset(outbuf, 0, 4);
r->iov.iov_len = 4;
- if (s->sense == NOT_READY && len >= 18) {
+ if (s->qdev.sense.key == NOT_READY && len >= 18) {
memset(outbuf, 0, 18);
r->iov.iov_len = 18;
outbuf[7] = 10;
@@ -404,7 +403,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
}
outbuf[0] = 0xf0;
outbuf[1] = 0;
- outbuf[2] = s->sense;
+ outbuf[2] = s->qdev.sense.key;
+ scsi_dev_clear_sense(&s->qdev);
break;
case INQUIRY:
DPRINTF("Inquiry (len %d)\n", len);