]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/block-copy: make progress_bytes_callback optional
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Sat, 16 Jan 2021 21:46:57 +0000 (00:46 +0300)
committerMax Reitz <mreitz@redhat.com>
Tue, 26 Jan 2021 13:36:37 +0000 (14:36 +0100)
We are going to stop use of this callback in the following commit.
Still the callback handling code will be dropped in a separate commit.
So, for now let's make it optional.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210116214705.822267-16-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/block-copy.c

index 82cf9456934bb0e40f829942a0ca85bfbda622a3..61d82d9a1c53eb94ddb8004a603d8e18d5d16697 100644 (file)
@@ -454,7 +454,9 @@ static coroutine_fn int block_copy_task_entry(AioTask *task)
         t->call_state->error_is_read = error_is_read;
     } else {
         progress_work_done(t->s->progress, t->bytes);
-        t->s->progress_bytes_callback(t->bytes, t->s->progress_opaque);
+        if (t->s->progress_bytes_callback) {
+            t->s->progress_bytes_callback(t->bytes, t->s->progress_opaque);
+        }
     }
     co_put_to_shres(t->s->mem, t->bytes);
     block_copy_task_end(t, ret);