From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51180 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObFX8-0000AX-45 for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:19:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObFWg-0008Uq-7I for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:18:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49580) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObFWf-0008Uc-VM for qemu-devel@nongnu.org; Tue, 20 Jul 2010 12:18:38 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6KGIaZH009848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Jul 2010 12:18:37 -0400 Message-ID: <4C45CC5A.1000900@redhat.com> Date: Tue, 20 Jul 2010 18:18:34 +0200 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Disable O_DIRECT for physical CDROM/DVD drives References: <1279639056-20465-1-git-send-email-Jes.Sorensen@redhat.com> <4C45C350.9000707@redhat.com> <4C45C8F1.9070705@redhat.com> <4C45CB01.4020008@redhat.com> In-Reply-To: <4C45CB01.4020008@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 07/20/10 18:12, Kevin Wolf wrote: > Am 20.07.2010 18:04, schrieb Jes Sorensen: >> On 07/20/10 17:40, Kevin Wolf wrote: >> Thats effectively what my patch does. cdrom_open() calls >> raw_open_common() which has this part: >> >> /* Use O_DSYNC for write-through caching, no flags for write-back >> caching, >> * and O_DIRECT for no caching. */ >> if ((bdrv_flags & BDRV_O_NOCACHE)) >> s->open_flags |= O_DIRECT; > > s and bs both have a field open_flags (and I think they share some more > field names, which has caused confusion more than once). I meant the bs > one here. > > Kevin Hi, It shows up even that case is handled as one of the first things bdrv_open_common() does is to set bs->open_flags = flags. Anyway throwing an error as Anthony suggested seems safer. Cheers, Jes