From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIFLN-0001rV-J8 for qemu-devel@nongnu.org; Mon, 24 Oct 2011 03:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIFLM-0000Hp-8B for qemu-devel@nongnu.org; Mon, 24 Oct 2011 03:53:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIFLM-0000Hb-0H for qemu-devel@nongnu.org; Mon, 24 Oct 2011 03:53:12 -0400 Message-ID: <4EA51963.5060904@redhat.com> Date: Mon, 24 Oct 2011 09:53:07 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1319216912-26964-1-git-send-email-kwolf@redhat.com> <4EA1BD95.8030205@redhat.com> <4EA515B9.8070204@redhat.com> In-Reply-To: <4EA515B9.8070204@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2] block: Write out internal caches even with cache=unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alexander Graf , qemu-devel@nongnu.org, avi@redhat.com On 10/24/2011 09:37 AM, Kevin Wolf wrote: >> Why? cache=unsafe is explicitly allowing to s/data/manure/ on >> crash. > > It's surely expected on a host crash, but is it for a qemu crash? > cache=unsafe was introduced to avoid fsync() costs, which it still > does after this patch. I think it's not about "why is it there", but rather about "what is it useful for". My interpretation of it is "I do not need the image anymore unless the command exits cleanly": VM installations, qemu-img conversions, BDRV_O_SNAPSHOT (doesn't do it yet, but it could). Even SIGINT and SIGTERM would be excluded from this definition, but they cost nothing so it's nice to include them. >> If you do this for raw-posix, you need to do it for all protocols. > > rbd could use it, too, right. Any other protocol I missed? NBD could, but it doesn't support flush yet. In general, even if it were useful to implement this, I'm not sure this is the best way to implement it. For example you could simply clear BDRV_O_NO_FLUSH in qcow2_open. Paolo