qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v7 34/47] backup: Deal with filters


From: Andrey Shinkevich
Subject: Re: [PATCH v7 34/47] backup: Deal with filters
Date: Thu, 23 Jul 2020 18:51:30 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 25.06.2020 18:22, Max Reitz wrote:
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
  block/backup-top.c |  2 +-
  block/backup.c     |  9 +++++----
  blockdev.c         | 19 +++++++++++++++----
  3 files changed, 21 insertions(+), 9 deletions(-)


diff --git a/block/backup.c b/block/backup.c
index 4f13bb20a5..9afa0bf3b4 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -297,6 +297,7 @@ static int64_t 
backup_calculate_cluster_size(BlockDriverState *target,
  {
      int ret;
      BlockDriverInfo bdi;
+    bool target_does_cow = bdrv_backing_chain_next(target);


Wouldn't it better to make the explicit type conversion or use "!!" approach?

Andrey


      /*
       * If there is no backing file on the target, we cannot rely on COW if our
@@ -304,7 +305,7 @@ static int64_t 
backup_calculate_cluster_size(BlockDriverState *target,
       * targets with a backing file, try to avoid COW if possible.
       */
      ret = bdrv_get_info(target, &bdi);
-    if (ret == -ENOTSUP && !target->backing) {
+    if (ret == -ENOTSUP && !target_does_cow) {
          /* Cluster size is not defined */

...

Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>





reply via email to

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