mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
d51590fc3e
commit
511e7d31bf
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue