From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr8qA-0005kD-KP for qemu-devel@nongnu.org; Fri, 04 Jan 2013 10:05:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tr8q9-0004H9-6b for qemu-devel@nongnu.org; Fri, 04 Jan 2013 10:05:46 -0500 Received: from smtp.eu.citrix.com ([46.33.159.39]:12839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr8q8-0004Gm-Ta for qemu-devel@nongnu.org; Fri, 04 Jan 2013 10:05:45 -0500 Message-ID: <50E6EFC5.9060106@citrix.com> Date: Fri, 4 Jan 2013 16:05:41 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= MIME-Version: 1.0 References: <1356956174-23548-1-git-send-email-roger.pau@citrix.com> <1356956174-23548-2-git-send-email-roger.pau@citrix.com> <1357223336.10985.132.camel@zakaz.uk.xensource.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] [PATCH RFC 1/3] xen_disk: handle disk files on ramfs/tmpfs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: Anthony Perard , "xen-devel@lists.xen.org" , Ian Campbell , "qemu-devel@nongnu.org" On 04/01/13 15:54, Stefano Stabellini wrote: > On Thu, 3 Jan 2013, Ian Campbell wrote: >> On Mon, 2012-12-31 at 12:16 +0000, Roger Pau Monne wrote: >>> Files that reside on ramfs or tmpfs cannot be opened with O_DIRECT, >>> if first call to bdrv_open fails with errno = EINVAL, try a second >>> call without BDRV_O_NOCACHE. >> >> Doesn't that risk spuriously turning of NOCACHE on other sorts of >> devices as well which (potentially) opens up a data loss issue? > > I agree, we shouldn't have this kind of critical configuration changes > behind the user's back. > > I would rather let the user set the cache attributes, QEMU has already a > command line option for it, but we can't use it directly because > xen_disk gets the configuration solely from xenstore at the moment. > > I guess we could add a key pair cache=foobar to the xl disk > configuration spec, that gets translated somehow to a key on xenstore. > Xen_disk would read the key and sets qflags accordingly. > We could use the same cache parameters supported by QEMU, see > bdrv_parse_cache_flags. > > As an alternative, we could reuse the already defined "access" key, like > this: > > access=rw|nocache > > or > > access=rw|unsafe I needed this patch to be able to perform the benchmarks for the persistent grants implementation, but I realize this is not the best way to solve this problem. It might be worth to think of a good way to pass more information to the qdisk backend (not only limited to whether O_DIRECT should be used or not), so we can take advantage in the future of all the possible file backends that Qemu supports, like GlusterFS or SheepDog.