Received: from [140.186.70.92] (port=56675 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Owddr-0000Cb-Fb for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Owddk-0001W1-S6 for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44591) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owddk-0001Vq-GY for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:20 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8HGIK6V030427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Sep 2010 12:18:20 -0400 From: Kevin Wolf Date: Fri, 17 Sep 2010 18:18:35 +0200 Message-Id: <1284740318-20838-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1284740318-20838-1-git-send-email-kwolf@redhat.com> References: <1284740318-20838-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/4] qcow2: Move sync out of write_refcount_block_entries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 4c19e7e..7dc75d1 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -444,7 +444,7 @@ static int write_refcount_block_entries(BlockDriverState *bs, size = (last_index - first_index) << REFCOUNT_SHIFT; BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_UPDATE_PART); - ret = bdrv_pwrite_sync(bs->file, + ret = bdrv_pwrite(bs->file, refcount_block_offset + (first_index << REFCOUNT_SHIFT), &s->refcount_block_cache[first_index], size); if (ret < 0) { @@ -551,6 +551,8 @@ fail: dummy = update_refcount(bs, offset, cluster_offset - offset, -addend); } + bdrv_flush(bs->file); + return ret; } -- 1.7.2.2