aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-01-17 00:46:58 +0300
committerMax Reitz <mreitz@redhat.com>2021-01-26 14:36:37 +0100
commit511e7d31bf107aca331ab834f71c90267f803960 (patch)
tree673134f4ea8f097505c676a1afc6153834d6b066 /block
parentd51590fc3eb0589e0e82ed960da976d0442e662a (diff)
downloadqemu-511e7d31bf107aca331ab834f71c90267f803960.zip
qemu-511e7d31bf107aca331ab834f71c90267f803960.tar.gz
qemu-511e7d31bf107aca331ab834f71c90267f803960.tar.bz2
block/backup: drop extra gotos from backup_run()
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210116214705.822267-17-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/backup.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/block/backup.c b/block/backup.c
index 5522c0f..466608e 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -236,7 +236,7 @@ static void backup_init_bcs_bitmap(BackupBlockJob *job)
static int coroutine_fn backup_run(Job *job, Error **errp)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
- int ret = 0;
+ int ret;
backup_init_bcs_bitmap(s);
@@ -246,13 +246,12 @@ static int coroutine_fn backup_run(Job *job, Error **errp)
for (offset = 0; offset < s->len; ) {
if (yield_and_check(s)) {
- ret = -ECANCELED;
- goto out;
+ return -ECANCELED;
}
ret = block_copy_reset_unallocated(s->bcs, offset, &count);
if (ret < 0) {
- goto out;
+ return ret;
}
offset += count;
@@ -273,11 +272,10 @@ static int coroutine_fn backup_run(Job *job, Error **errp)
job_yield(job);
}
} else {
- ret = backup_loop(s);
+ return backup_loop(s);
}
- out:
- return ret;
+ return 0;
}
static const BlockJobDriver backup_job_driver = {