]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/qcow2.c
qcow2: avoid extra flushes in qcow2
[mirror_qemu.git] / block / qcow2.c
index 5e26c3d5b7e2061d7df9f922cd5d1f85f04f930a..6f5fb810e4fc7039d18b00251ebf43b9d75e253e 100644 (file)
@@ -2813,14 +2813,14 @@ static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs)
     int ret;
 
     qemu_co_mutex_lock(&s->lock);
-    ret = qcow2_cache_flush(bs, s->l2_table_cache);
+    ret = qcow2_cache_write(bs, s->l2_table_cache);
     if (ret < 0) {
         qemu_co_mutex_unlock(&s->lock);
         return ret;
     }
 
     if (qcow2_need_accurate_refcounts(s)) {
-        ret = qcow2_cache_flush(bs, s->refcount_block_cache);
+        ret = qcow2_cache_write(bs, s->refcount_block_cache);
         if (ret < 0) {
             qemu_co_mutex_unlock(&s->lock);
             return ret;