Commit ed6a9b307b006d066beaf875bbd0b5b9164349c5

Authored by blueswir1
1 parent b2056c16

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
Showing 1 changed file with 9 additions and 1 deletions
hw/scsi-disk.c
... ... @@ -423,10 +423,18 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
423 423 if (len < 4)
424 424 goto fail;
425 425 memset(outbuf, 0, 4);
  426 + r->buf_len = 4;
  427 + if (s->sense == SENSE_NOT_READY && len >= 18) {
  428 + memset(outbuf, 0, 18);
  429 + r->buf_len = 18;
  430 + outbuf[7] = 10;
  431 + /* asc 0x3a, ascq 0: Medium not present */
  432 + outbuf[12] = 0x3a;
  433 + outbuf[13] = 0;
  434 + }
426 435 outbuf[0] = 0xf0;
427 436 outbuf[1] = 0;
428 437 outbuf[2] = s->sense;
429   - r->buf_len = 4;
430 438 break;
431 439 case 0x12:
432 440 DPRINTF("Inquiry (len %d)\n", len);
... ...