From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObZ9A-0003EL-06 for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObZ95-0002sr-5X for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:15:39 -0400 Received: from verein.lst.de ([213.95.11.210]:53259) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObZ94-0002rx-RE for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:15:35 -0400 Date: Wed, 21 Jul 2010 15:15:26 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH v3] Error on O_DIRECT for physical CDROM/DVD drives Message-ID: <20100721131526.GA19963@lst.de> References: <1279698319-31158-1-git-send-email-Jes.Sorensen@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1279698319-31158-1-git-send-email-Jes.Sorensen@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: qemu-devel@nongnu.org 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.