diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-19 15:03:36 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-19 15:03:36 +0000 |
commit | d5b4eb4016e70ae4d80367306c826deb0defc04c (patch) | |
tree | db168c15f97d2095c740fc3f80e6cf58845eed1d /hw | |
parent | 3dec6ecd31f141ea21c8490fce234e6f6edcee6e (diff) | |
download | qemu-d5b4eb4016e70ae4d80367306c826deb0defc04c.zip qemu-d5b4eb4016e70ae4d80367306c826deb0defc04c.tar.gz qemu-d5b4eb4016e70ae4d80367306c826deb0defc04c.tar.bz2 |
Fix media detection on emulated CDROM (Gary Grebus)
This patch tweaks the ATAPI CDROM emulation to fix an annoyance seen
when running a variety of Linux guests: the desktop GUI shows a CDROM
device as present, but is unable to automount the media and display its
contents.
The patch adds the PLAY_AUDIO capability bit to the data returned by
MODE_SENSE commands. That convinces the guest kernel to determine what
kind of media is present.
Arguably Linux could be smarter about this, but it's my guess there are
few (if any) hardware CDROM drives that don't set the bit, and there are
a large number of Linux distros that exhibit this problem.
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5752 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1603,7 +1603,9 @@ static void ide_atapi_cmd(IDEState *s) buf[10] = 0x00; buf[11] = 0x00; - buf[12] = 0x70; + /* Claim PLAY_AUDIO capability (0x01) since some Linux + code checks for this to automount media. */ + buf[12] = 0x71; buf[13] = 3 << 5; buf[14] = (1 << 0) | (1 << 3) | (1 << 5); if (bdrv_is_locked(s->bs)) |