From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzSJe-00065r-Ld for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:21:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzSJd-0002oW-6v for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:21:30 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:41054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzSJd-0002oK-2V for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:21:29 -0400 Received: by gxk26 with SMTP id 26so237682gxk.4 for ; Tue, 15 Mar 2011 04:21:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20110315105040.GA25001@lst.de> References: <20110314171627.GB1062@lst.de> <20110315105040.GA25001@lst.de> Date: Tue, 15 Mar 2011 11:21:28 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: Write cache enable from guest at runtime List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , Anthony Liguori , qemu-devel , Prerna Saxena On Tue, Mar 15, 2011 at 10:50 AM, Christoph Hellwig wrote: > On Mon, Mar 14, 2011 at 07:15:14PM +0000, Stefan Hajnoczi wrote: >> Sounds like a good idea. =A0Feel free to post the patches RFC and I or >> someone else can debug and polish them if you don't have time. > > By looking at your document and doing what you recommend against I think = I > got a much simpler solution than what I had before. > > I didn't know we could actually write to the config space. =A0The vpcu > synchronous behaviour is not a problem as it's done seldomly, and we > can trivially check against errors by reading the value back. > > I've just started building this variant, and it seems surprisingly simple= . I didn't think about the just reading the value back. What do you think about reopening the file via /proc/$pid/fd/$old_fd? I wrote a test and had a look at the proc fd code. It seems to work fine and doesn't require an O_SYNC runtime change kernel patch. It allows us to fall back to the old fd if the new file cannot be opened and it works even when the old file has been deleted. Stefan