Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2oah-0007Do-KW for qemu-devel@nongnu.org; Wed, 19 Nov 2008 10:03:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2oah-0007Da-9X for qemu-devel@nongnu.org; Wed, 19 Nov 2008 10:03:39 -0500 Received: from [199.232.76.173] (port=50777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2oah-0007DV-0a for qemu-devel@nongnu.org; Wed, 19 Nov 2008 10:03:39 -0500 Received: from savannah.gnu.org ([199.232.41.3]:59745 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L2oag-0002M8-7s for qemu-devel@nongnu.org; Wed, 19 Nov 2008 10:03:38 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L2oaf-0002OA-9Q for qemu-devel@nongnu.org; Wed, 19 Nov 2008 15:03:37 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L2oae-0002O5-Tb for qemu-devel@nongnu.org; Wed, 19 Nov 2008 15:03:37 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 19 Nov 2008 15:03:36 +0000 Subject: [Qemu-devel] [5752] Fix media detection on emulated CDROM (Gary Grebus) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5752 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5752 Author: aliguori Date: 2008-11-19 15:03:36 +0000 (Wed, 19 Nov 2008) Log Message: ----------- 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/ide.c Modified: trunk/hw/ide.c =================================================================== --- trunk/hw/ide.c 2008-11-19 01:31:52 UTC (rev 5751) +++ trunk/hw/ide.c 2008-11-19 15:03:36 UTC (rev 5752) @@ -1603,7 +1603,9 @@ 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))