From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K62qy-0003cb-KL for qemu-devel@nongnu.org; Tue, 10 Jun 2008 08:21:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K62qx-0003cF-OS for qemu-devel@nongnu.org; Tue, 10 Jun 2008 08:21:32 -0400 Received: from [199.232.76.173] (port=47931 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K62qx-0003cC-Lw for qemu-devel@nongnu.org; Tue, 10 Jun 2008 08:21:31 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:24635) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K62qx-0008VO-9m for qemu-devel@nongnu.org; Tue, 10 Jun 2008 08:21:31 -0400 Subject: Re: [Qemu-devel] [PATCH][RESEND] ide: fix ATAPI read drive structure command (v3) From: Alex Williamson In-Reply-To: <20080609085220.GA24218@tapir> References: <1212977645.10496.217.camel@bling> <20080609085220.GA24218@tapir> Content-Type: text/plain Date: Tue, 10 Jun 2008 06:21:20 -0600 Message-Id: <1213100480.7898.8.camel@bling> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Hi Carlo, On Mon, 2008-06-09 at 03:52 -0500, Carlo Marcelo Arenas Belon wrote: > On Sun, Jun 08, 2008 at 08:14:05PM -0600, Alex Williamson wrote: > > Hi, > > > > Resend of patch from last week. This has been review by Alexander Graf > > and Anthony Liguori. The patch fixes diskpart.exe working in Vista when > > a DVD image is loaded. Please apply to trunk. Thanks, > > Tested it with Linux/OpenSolaris guests and confirmed no obvious regressions > but I haven't traced specifically calls to this function (as used by diskpart > in Vista). Thanks for testing. > > + if (format < 0xff && media_is_cd(s)) { > > ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, > > - ASC_INV_FIELD_IN_CMD_PACKET); > > + ASC_INCOMPATIBLE_FORMAT); > > + break; > > couldn't find a reference to this in MMC6's READ DISK STRUCTURE command, why > is format = 0xff allowed if the media is a CD, what about when there is no > media? >>From mmc-6r1 draft, section 6.22.3.1.7 (Format Code FFh: Disc Structure List): This Disc Structure is generated by the Drive rather than read from the medium. Consequently, this structure shall be returned regardless of media presence. Drive implementations that I tested with sg_raw seem to vary quite a bit here. One drive I had on hand behaved as I would expect and returned data for format 0xff with CD or DVD media or empty. Another only returned data if DVD media was loaded. I think the patch implements it per the spec. Let me know if you disagree. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org.