From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDUn3-0000Ol-1v for qemu-devel@nongnu.org; Tue, 11 Oct 2011 01:22:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDUn0-0001md-PM for qemu-devel@nongnu.org; Tue, 11 Oct 2011 01:22:09 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:55735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDUn0-0001m7-26 for qemu-devel@nongnu.org; Tue, 11 Oct 2011 01:22:06 -0400 Received: from /spool/local by in.ibm.com with XMail ESMTP for from ; Tue, 11 Oct 2011 10:52:02 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9B5LvgF3969032 for ; Tue, 11 Oct 2011 10:51:58 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9B5Lvql018838 for ; Tue, 11 Oct 2011 16:21:57 +1100 Message-ID: <4E93D274.3060504@linux.vnet.ibm.com> Date: Tue, 11 Oct 2011 10:51:56 +0530 From: Supriya Kannery MIME-Version: 1.0 References: <4E3BB203.5060703@redhat.com> <20110805131247.GC6201@redhat.com> <20110805142812.GB17323@lst.de> <4E3C0FAA.2080303@redhat.com> <4E3C1117.8000009@codemonkey.ws> <4E3F89FC.8090109@linux.vnet.ibm.com> <4E3F9A7E.1090906@redhat.com> <4E40FC59.7010104@in.ibm.com> <4E93394F.90602@redhat.com> In-Reply-To: <4E93394F.90602@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Safely reopening image files by stashing fds Reply-To: supriyak@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , Paolo Bonzini , Christoph Hellwig , qemu-devel , supriya kannery On 10/10/2011 11:58 PM, Kevin Wolf wrote: > Am 09.08.2011 11:22, schrieb supriya kannery: >> Kevin Wolf wrote: >>> Am 08.08.2011 09:02, schrieb Supriya Kannery: >>> >>>> On 08/05/2011 09:19 PM, Anthony Liguori wrote: >>>> >>>>> On 08/05/2011 10:43 AM, Kevin Wolf wrote: >>>>> >>>>>> Am 05.08.2011 17:24, schrieb Stefan Hajnoczi: >>>>>> >>>>>>> On Fri, Aug 5, 2011 at 3:28 PM, Christoph Hellwig wrote: >>>>>>> >>>>>>>> On Fri, Aug 05, 2011 at 02:12:48PM +0100, Daniel P. Berrange wrote: >>>>>>>> >>>>>>>>>> Because you cannot change O_DIRECT on an open fd :(. This is why >>>>>>>>>> we're going through this pain. >>>>>>>>>> >>>>>>>>> Hmm, I remember hearing that before, but looking at the current >>>>>>>>> fcntl() >>>>>>>>> manpage, it claims you *can* change O_DIRECT using SET_FL. Perhaps >>>>>>>>> this >>>>>>>>> is a newish feature, but it'd be nicer to use it if possible ? >>>>>>>>> >>>>>>>> It's been there since day 1 of O_DIRECT support. >>>>>>>> >>>>>>> Sorry, my bad. So for Linux we could just use fcntl for >>>>>>> block_set_hostcache and not bother with reopening. However, we will >>>>>>> need to reopen should we wish to support changing O_DSYNC. >>>>>>> >>>>>> We do wish to support that. >>>>>> >>>>>> Anthony thinks that allowing the guest to toggle WCE is a prerequisite >>>>>> for making cache=writeback the default. And this is something that I >>>>>> definitely want to do for 1.0. >>>>>> >>>>> Indeed. >>>>> >>>>> >>>> We discussed the following so far... >>>> 1. How to safely reopen image files >>>> 2. Dynamic hostcache change >>>> 3. Support for dynamic change of O_DSYNC >>>> >>>> Since 2 is independent of 1, shall I go ahead implementing >>>> hostcache change using fcntl. >>>> >>>> Implementation for safely reopening image files using "BDRVReopenState" >>>> can be done separately as a pre-requisite before implementing 3 >>>> >>> >>> Doing it separately means that we would introduce yet another callback >>> that is used just to change O_DIRECT. In the end we want it to use >>> bdrv_reopen(), too, so I'm not sure if there is a need for a temporary >>> solution. >>> >>> >> Could you please explain "In the end we want it to use bdrv_reopen" at >> bit more. >> When fcntl() can change O_DIRECT on open fd , is there a need to >> "re-open" >> the image file? >> >> Considering the current way of having separate high level commands for >> changing block parameters (block_set_hostcache, and may be block_set_flush >> in furture), these dynamic requests will be sequential. So wouldn't it >> be better to >> avoid re-opening of image if possible for individual flag change request >> that comes in? >>> Actually, once we know what we really want (I haven't seen many comments >>> on the BDRVReopenState suggestion yet), it should be pretty easy to >>> implement. >>> >>> Kevin >>> >> Will work on to get an RFC patch with this proposed BDRVReopenState to >> get more >> inputs. > > Are you still going to prepare an RFC patch implementing > bdrv_reopen_prepare/commit/abort using a BDRVReopenState? Or has it even > been posted and I just missed it? > > Kevin Pls review the patchset posted at http://lists.gnu.org/archive/html/qemu-devel/2011-10/msg01014.html Working on further to similarly use BDRVReopenState for raw-win32 images. thanks, Supriya