aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-29 15:40:59 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-29 15:40:59 +0000
commit58a2c43689f0247371577373e96db4eb6a3abe39 (patch)
tree9c89e4393e56728f990b908f2cb1c17d5ef1168b /hw/scsi-disk.c
parented6a9b307b006d066beaf875bbd0b5b9164349c5 (diff)
Misc scsi disk/cdrom fixes/improvements 4/4
Implement Test Unit Ready command (return NOT READY as above if !bdrv_is_inserted(...)) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6954 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 489e24caf2..c7b2febd86 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -417,6 +417,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
switch (command) {
case 0x0:
DPRINTF("Test Unit Ready\n");
+ if (!bdrv_is_inserted(s->bdrv))
+ goto notready;
break;
case 0x03:
DPRINTF("Request Sense (len %d)\n", len);
@@ -766,6 +768,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
outbuf[7] = 0;
r->buf_len = 8;
} else {
+ notready:
scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_NOT_READY);
return 0;
}