Received: from [140.186.70.92] (port=49034 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oba2x-00070s-Ag for qemu-devel@nongnu.org; Wed, 21 Jul 2010 10:13:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oba2t-00064y-6l for qemu-devel@nongnu.org; Wed, 21 Jul 2010 10:13:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53647) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oba2s-00064S-VD for qemu-devel@nongnu.org; Wed, 21 Jul 2010 10:13:15 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH v3] Error on O_DIRECT for physical CDROM/DVD drives References: <1279698319-31158-1-git-send-email-Jes.Sorensen@redhat.com> <20100721131526.GA19963@lst.de> Date: Wed, 21 Jul 2010 16:13:10 +0200 In-Reply-To: <20100721131526.GA19963@lst.de> (Christoph Hellwig's message of "Wed, 21 Jul 2010 15:15:26 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Jes.Sorensen@redhat.com, qemu-devel@nongnu.org Christoph Hellwig writes: > On Wed, Jul 21, 2010 at 09:45:19AM +0200, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen >> >> O_DIRECT (cache=none) requires sector alignment, however the physical >> sector size of CDROM/DVD drives is 2048, as opposed to most disk >> devices which use 512. QEMU is hard coding 512 all over the place, so >> allowing O_DIRECT for CDROM/DVD devices does not work. >> >> Return -ENOTSUP from cdrom_open() in this case. > > The patch is not quite correct. There are CDROMs with 512 byte sectors, > just as there are disks with larger sector sizes. And of course these > limitations also apply when running ontop of filesystems. > > So we really need to handle these things better and need to query > the sector size of the device and handle it properly. Agreed, but I figure Jes's fix is the best we can do for .13, and worth doing for .13.