diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-29 15:40:21 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-29 15:40:21 +0000 |
commit | b2056c167dc837e80afaf69f23ba0a68d95fe395 (patch) | |
tree | 83a89817d5bca2f179324d7f9f89687e024a4b6b /hw/scsi-disk.c | |
parent | ee16b24ac827de58c85ef65189e0888cdf9382bc (diff) |
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
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index da3fa417be..6438fb60d1 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -725,6 +725,10 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, break; case 0x1b: DPRINTF("Start Stop Unit\n"); + if (bdrv_get_type_hint(s->bdrv) == BDRV_TYPE_CDROM && + (buf[4] & 2)) + /* load/eject medium */ + bdrv_eject(s->bdrv, !(buf[4] & 1)); break; case 0x1e: DPRINTF("Prevent Allow Medium Removal (prevent = %d)\n", buf[4] & 3); |