From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSnFj-0004DU-F7 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 05:07:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSnFg-0005yK-Vb for qemu-devel@nongnu.org; Tue, 22 Nov 2011 05:06:58 -0500 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:48447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSnFf-0005xf-2M for qemu-devel@nongnu.org; Tue, 22 Nov 2011 05:06:56 -0500 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Nov 2011 15:36:47 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAMA6gVl4685956 for ; Tue, 22 Nov 2011 15:36:43 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAMA6gYg001454 for ; Tue, 22 Nov 2011 15:36:42 +0530 Message-ID: <4ECB6F43.8060000@in.ibm.com> Date: Tue, 22 Nov 2011 15:15:39 +0530 From: supriya kannery MIME-Version: 1.0 References: <20111111064707.15024.69847.sendpatchset@skannery.in.ibm.com> <20111111064833.15024.54047.sendpatchset@skannery.in.ibm.com> <4ECA447A.40500@in.ibm.com> In-Reply-To: <4ECA447A.40500@in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v9 Patch 6/6]Qemu: raw posix implementation of reopen functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Supriya Kannery , Christoph Hellwig , qemu-devel@nongnu.org, Luiz Capitulino supriya kannery wrote: > Stefan Hajnoczi wrote: >> On Fri, Nov 11, 2011 at 6:48 AM, Supriya Kannery >> wrote: >> >>> + } >>> + if ((flags & BDRV_O_NOCACHE)) { >>> + raw_rs->reopen_state.reopen_flags |= O_DIRECT; >>> + } else { >>> + raw_rs->reopen_state.reopen_flags &= ~O_DIRECT; >>> + } >>> + ret = fcntl_setfl(raw_rs->reopen_fd, >>> raw_rs->reopen_state.reopen_flags); >>> >> >> I wonder if this works on Solaris, FreeBSD, etc? >> >> Perhaps there needs to be a fallback to the missing "else" case below... >> >> > > ok. Will look into whether this will work on Solaris, FreeBSD etc.. > This should work for all non-win Oses. I have tested only in x86. #ifndef _WIN32 /* Sets a specific flag */ int fcntl_setfl(int fd, int flag) { int flags; flags = fcntl(fd, F_GETFL); - thanks, Supriya