diff options
author | Tuguoyi <tu.guoyi@h3c.com> | 2019-12-18 11:53:35 +0000 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-12-19 14:31:52 +0100 |
commit | 66be5c3e7825cab861b3d68e87851a4ac9ff8c3d (patch) | |
tree | 40bd29e7968fb078e1cbce21738950244c32b580 /block | |
parent | eb4ea9aaa0051054b3c148ad8631be7510851681 (diff) | |
download | qemu-66be5c3e7825cab861b3d68e87851a4ac9ff8c3d.zip qemu-66be5c3e7825cab861b3d68e87851a4ac9ff8c3d.tar.gz qemu-66be5c3e7825cab861b3d68e87851a4ac9ff8c3d.tar.bz2 |
qcow2: Move error check of local_err near its assignment
The local_err check outside of the if block was necessary
when it was introduced in commit d1258dd0c87 because it needed to be
executed even if qcow2_load_autoloading_dirty_bitmaps() returned false.
After some modifications that all required the error check to remain
where it is, commit 9c98f145dfb finally moved the
qcow2_load_dirty_bitmaps() call into the if block, so now the error
check should be there, too.
Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/qcow2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 375bbd0..7fbaac8 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1705,14 +1705,14 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, if (!(bdrv_get_flags(bs) & BDRV_O_INACTIVE)) { /* It's case 1, 2 or 3.2. Or 3.1 which is BUG in management layer. */ bool header_updated = qcow2_load_dirty_bitmaps(bs, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + ret = -EINVAL; + goto fail; + } update_header = update_header && !header_updated; } - if (local_err != NULL) { - error_propagate(errp, local_err); - ret = -EINVAL; - goto fail; - } if (update_header) { ret = qcow2_update_header(bs); |