From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm32V-0007vB-Qx for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:21:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm32L-0000t3-4S for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:21:11 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:39732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm32K-0000s0-Re for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:21:01 -0400 Received: by pbbro12 with SMTP id ro12so10303706pbb.4 for ; Tue, 03 Jul 2012 06:20:57 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 3 Jul 2012 15:20:40 +0200 Message-Id: <1341321642-24598-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [QEMU PATCH 0/2] virtio-blk: writeback cache enable improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, rusty@rustcorp.com.au, anthony@codemonkey.ws, kvm@vger.kernel.org, mst@redhat.com These patches let virtio-blk use the new support for toggling the cache mode between writethrough and writeback. The first patch introduces a new feature bit and configuration field to do this. The second patch disables writeback caching for guests that do not negotiate VIRTIO_BLK_F_WCACHE (meaning that they cannot send flush requests), so that limited or older guests are now safe wrt power losses. VIRTIO_BLK_F_FLUSH has been introduced in Linux 2.6.32 (in 2009) and was backported to RHEL/CentOS 5.6 (in 2010). The Windows drivers (which work by emulating SCSI on top of virtio-blk) have bugs in this area, which I reported on the Red Hat Bugzilla as bugs 837321 and 837324. With these patches they will suffer a performance hit but gain correctness. Paolo Bonzini (2): virtio-blk: support VIRTIO_BLK_F_CONFIG_WCE virtio-blk: disable write cache if not negotiated hw/virtio-blk.c | 30 ++++++++++++++++++++++++++++-- hw/virtio-blk.h | 4 +++- 2 files changed, 31 insertions(+), 3 deletions(-) -- 1.7.10.2