aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-01-17 00:46:57 +0300
committerMax Reitz <mreitz@redhat.com>2021-01-26 14:36:37 +0100
commitd51590fc3eb0589e0e82ed960da976d0442e662a (patch)
treefe195f5e9ba44ab9594a24e63e4083461190c203 /block
parent2d0f32e3fc160ee03c46daf4545371eeb836c600 (diff)
downloadqemu-d51590fc3eb0589e0e82ed960da976d0442e662a.zip
qemu-d51590fc3eb0589e0e82ed960da976d0442e662a.tar.gz
qemu-d51590fc3eb0589e0e82ed960da976d0442e662a.tar.bz2
block/block-copy: make progress_bytes_callback optional
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>
Diffstat (limited to 'block')
-rw-r--r--block/block-copy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/block-copy.c b/block/block-copy.c
index 82cf945..61d82d9 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -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);