From patchwork Sat Jul 9 13:02:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pekka Enberg X-Patchwork-Id: 959562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p69D3J0I004277 for ; Sat, 9 Jul 2011 13:03:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673Ab1GINDS (ORCPT ); Sat, 9 Jul 2011 09:03:18 -0400 Received: from filtteri2.pp.htv.fi ([213.243.153.185]:59359 "EHLO filtteri2.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753371Ab1GINDB (ORCPT ); Sat, 9 Jul 2011 09:03:01 -0400 Received: from localhost (localhost [127.0.0.1]) by filtteri2.pp.htv.fi (Postfix) with ESMTP id B20871DF11D; Sat, 9 Jul 2011 16:03:00 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp6.welho.com ([213.243.153.40]) by localhost (filtteri2.pp.htv.fi [213.243.153.185]) (amavisd-new, port 10024) with ESMTP id A7f8-wtVyYLI; Sat, 9 Jul 2011 16:03:00 +0300 (EEST) Received: from localhost.localdomain (cs181136138.pp.htv.fi [82.181.136.138]) by smtp6.welho.com (Postfix) with ESMTP id 7AADA5BC006; Sat, 9 Jul 2011 16:03:00 +0300 (EEST) From: Pekka Enberg To: kvm@vger.kernel.org Cc: Pekka Enberg , Asias He , Cyrill Gorcunov , Ingo Molnar , Prasad Joshi , Sasha Levin Subject: [PATCH 6/9] kvm tools, qcow: Don't fdatasync() L2 table writeout Date: Sat, 9 Jul 2011 16:02:39 +0300 Message-Id: <1310216563-17503-7-git-send-email-penberg@kernel.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1310216563-17503-1-git-send-email-penberg@kernel.org> References: <1310216563-17503-1-git-send-email-penberg@kernel.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Jul 2011 13:03:36 +0000 (UTC) There's now now point in making sure new L2 tables actually hit the disk before we write out data to clusters because they are not visible on-disk until qcow_disk_flush() is called which flushes the L1 table. Cc: Asias He Cc: Cyrill Gorcunov Cc: Ingo Molnar Cc: Prasad Joshi Cc: Sasha Levin Signed-off-by: Pekka Enberg --- tools/kvm/disk/qcow.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/disk/qcow.c b/tools/kvm/disk/qcow.c index 0fef92f..35408ab 100644 --- a/tools/kvm/disk/qcow.c +++ b/tools/kvm/disk/qcow.c @@ -345,7 +345,7 @@ static u64 qcow_write_l2_table(struct qcow *q, u64 *table) clust_sz = 1 << header->cluster_bits; off = ALIGN(f_sz, clust_sz); - if (qcow_pwrite_sync(q->fd, table, sz * sizeof(u64), off) < 0) + if (pwrite_in_full(q->fd, table, sz * sizeof(u64), off) < 0) return 0; return off;