qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/6] vmdk: Don't update L2 table for zero write on zero clust


From: Eric Blake
Subject: Re: [PATCH 4/6] vmdk: Don't update L2 table for zero write on zero cluster
Date: Thu, 30 Apr 2020 09:17:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/30/20 8:30 AM, Kevin Wolf wrote:
If a cluster is already zeroed, we don't have to call vmdk_L2update(),
which is rather slow because it flushes the image file.

Signed-off-by: Kevin Wolf <address@hidden>
---
  block/vmdk.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Eric Blake <address@hidden>

diff --git a/block/vmdk.c b/block/vmdk.c
index da25b8992e..dcd30f1419 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2013,7 +2013,7 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t 
offset,
                      offset_in_cluster == 0 &&
                      n_bytes >= extent->cluster_sectors * BDRV_SECTOR_SIZE) {
                  n_bytes = extent->cluster_sectors * BDRV_SECTOR_SIZE;
-                if (!zero_dry_run) {
+                if (!zero_dry_run && ret != VMDK_ZEROED) {
                      /* update L2 tables */
                      if (vmdk_L2update(extent, &m_data, VMDK_GTE_ZEROED)
                              != VMDK_OK) {


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]