From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41781 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObFIf-0003Ls-6F for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:04:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObFIG-0005o1-BZ for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:03:45 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:37011) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObFIG-0005nr-9G for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:03:44 -0400 Received: by gwj21 with SMTP id 21so2936228gwj.4 for ; Tue, 20 Jul 2010 09:03:43 -0700 (PDT) Message-ID: <4C45C8DC.9000200@codemonkey.ws> Date: Tue, 20 Jul 2010 11:03:40 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1279639056-20465-1-git-send-email-Jes.Sorensen@redhat.com> <4C45C355.2000204@codemonkey.ws> <4C45C87C.4060709@redhat.com> In-Reply-To: <4C45C87C.4060709@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Disable O_DIRECT for physical CDROM/DVD drives List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: qemu-devel@nongnu.org On 07/20/2010 11:02 AM, Jes Sorensen wrote: > On 07/20/10 17:40, Anthony Liguori wrote: > >> On 07/20/2010 10:17 AM, 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. >>> >>> Signed-off-by: Jes Sorensen >>> >>> >> Wouldn't a better solution be to have a cdrom_read/cdrom_write hook that >> did the appropriate bouncing? >> >> Silently disabling something a user explicitly asked for is not a good >> option. In the very least, it should error out entirely. >> > I thought about this, but it would require basically fixing up or > copying all of the pread/pwrite code to use the right block size. This > is really more of a band-aid but it should be pretty safe. > Please throw an error. If a user explicitly asks for something, and we can provide it, we should not continue. Changing it to something else is a bug. That doesn't apply when we're changing a default value, but if the user asks for something, we should give it to them or fail. Regards, Anthony Liguori > Cheers, > Jes >