diff options
author | Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> | 2019-05-29 20:56:15 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2019-07-02 03:53:04 +0200 |
commit | 96a07d5bf447e616361acd4181a0fb24377483d9 (patch) | |
tree | 989e42e6c85bd6f96db1a1320f5aa57928d9792f | |
parent | 170d3bd341b3955f10b40b4569f66bf3d4dbc4a0 (diff) |
block/stream: refactor stream_run: drop goto
The goto is unnecessary in the stream_run() since the common exit
code was removed in the commit eb23654dbe43b549ea2a9ebff9d8e:
"jobs: utilize job_exit shim".
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1559152576-281803-3-git-send-email-andrey.shinkevich@virtuozzo.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
-rw-r--r-- | block/stream.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/block/stream.c b/block/stream.c index 97fddb2608..65b13b27e0 100644 --- a/block/stream.c +++ b/block/stream.c @@ -120,13 +120,12 @@ static int coroutine_fn stream_run(Job *job, Error **errp) void *buf; if (!bs->backing) { - goto out; + return 0; } len = bdrv_getlength(bs); if (len < 0) { - ret = len; - goto out; + return len; } job_progress_set_remaining(&s->common.job, len); @@ -203,14 +202,10 @@ static int coroutine_fn stream_run(Job *job, Error **errp) bdrv_disable_copy_on_read(bs); } - /* Do not remove the backing file if an error was there but ignored. */ - ret = error; - qemu_vfree(buf); -out: - /* Modify backing chain and close BDSes in main loop */ - return ret; + /* Do not remove the backing file if an error was there but ignored. */ + return error; } static const BlockJobDriver stream_job_driver = { |