diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -1629,8 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file, assert(options != NULL && bs->options != options); opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort); - qemu_opts_absorb_qdict(opts, options, &local_err); - if (local_err) { + if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { error_propagate(errp, local_err); ret = -EINVAL; goto fail_opts; @@ -4091,8 +4090,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, /* Process generic block layer options */ opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort); - qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err); - if (local_err) { + if (!qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err)) { error_propagate(errp, local_err); ret = -EINVAL; goto error; @@ -6063,8 +6061,7 @@ void bdrv_img_create(const char *filename, const char *fmt, /* Parse -o options */ if (options) { - qemu_opts_do_parse(opts, options, NULL, &local_err); - if (local_err) { + if (!qemu_opts_do_parse(opts, options, NULL, &local_err)) { goto out; } } @@ -6077,8 +6074,8 @@ void bdrv_img_create(const char *filename, const char *fmt, } if (base_filename) { - qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_err); - if (local_err) { + if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, + &local_err)) { error_setg(errp, "Backing file not supported for file format '%s'", fmt); goto out; @@ -6086,8 +6083,7 @@ void bdrv_img_create(const char *filename, const char *fmt, } if (base_fmt) { - qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err); - if (local_err) { + if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err)) { error_setg(errp, "Backing file format not supported for file " "format '%s'", fmt); goto out; |