Commit b2056c167dc837e80afaf69f23ba0a68d95fe395
1 parent
ee16b24a
misc scsi disk/cdrom fixes/improvements 2/4
Implement cdrom load/eject functionality (Start Stop Unit command) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6952 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
0 deletions
hw/scsi-disk.c
... | ... | @@ -725,6 +725,10 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, |
725 | 725 | break; |
726 | 726 | case 0x1b: |
727 | 727 | DPRINTF("Start Stop Unit\n"); |
728 | + if (bdrv_get_type_hint(s->bdrv) == BDRV_TYPE_CDROM && | |
729 | + (buf[4] & 2)) | |
730 | + /* load/eject medium */ | |
731 | + bdrv_eject(s->bdrv, !(buf[4] & 1)); | |
728 | 732 | break; |
729 | 733 | case 0x1e: |
730 | 734 | DPRINTF("Prevent Allow Medium Removal (prevent = %d)\n", buf[4] & 3); | ... | ... |