From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NoHge-0003eO-9E for qemu-devel@nongnu.org; Sun, 07 Mar 2010 09:42:32 -0500 Received: from [199.232.76.173] (port=56808 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoHgd-0003eG-L5 for qemu-devel@nongnu.org; Sun, 07 Mar 2010 09:42:31 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NoHgc-0002Au-Qx for qemu-devel@nongnu.org; Sun, 07 Mar 2010 09:42:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6715) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NoHgc-0002Ak-FP for qemu-devel@nongnu.org; Sun, 07 Mar 2010 09:42:30 -0500 Message-ID: <4B93BB4A.8090605@redhat.com> Date: Sun, 07 Mar 2010 16:42:18 +0200 From: Avi Kivity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] bs->enable_write_cache and the guest ABI List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Christoph Hellwig block.c says: > /* > * Yes, BDRV_O_NOCACHE aka O_DIRECT means we have to present a > * write cache to the guest. We do need the fdatasync to flush > * out transactions for block allocations, and we maybe have a > * volatile write cache in our backing device to deal with. > */ > if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE)) > bs->enable_write_cache = 1; This means that if I start a guest with cache=writethrough and then restart (or live migrate) it with cache=none, then the guest will see a change, even though the user only changed the drive's backing, not something guest visible. In the case of live migration, the guest will not even notice the change and we may be at risk of data loss. For 0.13 I propose setting enable_write_cache to true unconditionally. For 0.12 the question is more difficult, since we'll be changing the guest ABI. Given that guests are unlikely not to be able to cope with write caches, and that the alternative is data loss, I believe that's also the right solution there. -- error compiling committee.c: too many arguments to function