提交 58a2c436 编写于 作者: B blueswir1

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: NJuergen Lock <nox@jelal.kn-bremen.de>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6954 c046a42c-6fe2-441c-8c8c-71466251a162
上级 ed6a9b30
...@@ -417,6 +417,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, ...@@ -417,6 +417,8 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
switch (command) { switch (command) {
case 0x0: case 0x0:
DPRINTF("Test Unit Ready\n"); DPRINTF("Test Unit Ready\n");
if (!bdrv_is_inserted(s->bdrv))
goto notready;
break; break;
case 0x03: case 0x03:
DPRINTF("Request Sense (len %d)\n", len); DPRINTF("Request Sense (len %d)\n", len);
...@@ -766,6 +768,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, ...@@ -766,6 +768,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
outbuf[7] = 0; outbuf[7] = 0;
r->buf_len = 8; r->buf_len = 8;
} else { } else {
notready:
scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_NOT_READY); scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_NOT_READY);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部