diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-29 15:40:42 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-29 15:40:42 +0000 |
commit | 407b5d65cc6fe76e1b2002b8b9922b49e79908cf (patch) | |
tree | fbe0ea9a21f0c051ee8fbb92b63a3ab96804a4b0 /hw/scsi-disk.c | |
parent | f41ecb13e7f605cd41cd55aa6373abc28efc3097 (diff) | |
download | qemu-407b5d65cc6fe76e1b2002b8b9922b49e79908cf.tar.gz qemu-407b5d65cc6fe76e1b2002b8b9922b49e79908cf.tar.bz2 qemu-407b5d65cc6fe76e1b2002b8b9922b49e79908cf.zip |
misc scsi disk/cdrom fixes/improvements 3/4
Add asc 0x3a, ascq 0: Medium not present to NOT READY sense
(needed to keep some guests from retrying causing long sleeps in the
kernel)
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6953 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 6438fb60d1..489e24caf2 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -423,10 +423,18 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, if (len < 4) goto fail; memset(outbuf, 0, 4); + r->buf_len = 4; + if (s->sense == SENSE_NOT_READY && len >= 18) { + memset(outbuf, 0, 18); + r->buf_len = 18; + outbuf[7] = 10; + /* asc 0x3a, ascq 0: Medium not present */ + outbuf[12] = 0x3a; + outbuf[13] = 0; + } outbuf[0] = 0xf0; outbuf[1] = 0; outbuf[2] = s->sense; - r->buf_len = 4; break; case 0x12: DPRINTF("Inquiry (len %d)\n", len); |