On Thu, Dec 5, 2013 at 8:11 PM, Markus Armbruster <arm...@redhat.com> wrote: > Peter Crosthwaite <peter.crosthwa...@xilinx.com> writes: > >> This is a boiler-plate _nofail variant of qemu_opts_create. Remove and >> use error_abort in call sites. >> >> null/0 arguments needs to be added for the id and fail_if_exists fields >> in affected callsites due to argument inconsistency between the normal and >> no_fail variants. >> >> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> >> --- >> changed since v1: >> Wrap some long lines (Markus review) >> Flip fail_if_exists to 0 in call sites (Markus review) >> Remove spurious whitespace fix (Markus review) >> Mention fail_if_exists in commit msg (Markus review) >> >> block/blkdebug.c | 2 +- >> block/blkverify.c | 2 +- >> block/curl.c | 2 +- >> block/gluster.c | 2 +- >> block/iscsi.c | 2 +- >> block/nbd.c | 3 ++- >> block/qcow2.c | 2 +- >> block/raw-posix.c | 2 +- >> block/raw-win32.c | 5 +++-- >> block/rbd.c | 2 +- >> block/sheepdog.c | 2 +- >> block/vvfat.c | 2 +- >> blockdev.c | 6 ++++-- >> hw/watchdog/watchdog.c | 3 ++- >> include/qemu/option.h | 1 - >> qdev-monitor.c | 2 +- >> qemu-img.c | 2 +- >> util/qemu-config.c | 2 +- >> util/qemu-option.c | 9 --------- >> util/qemu-sockets.c | 18 +++++++++--------- >> vl.c | 15 +++++++++------ >> 21 files changed, 42 insertions(+), 44 deletions(-) >> >> diff --git a/block/blkdebug.c b/block/blkdebug.c >> index 16d2b91..7f915ea 100644 >> --- a/block/blkdebug.c >> +++ b/block/blkdebug.c >> @@ -359,7 +359,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict >> *options, int flags, >> const char *filename, *config; >> int ret; >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> diff --git a/block/blkverify.c b/block/blkverify.c >> index 3c63528..1c1637f 100644 >> --- a/block/blkverify.c >> +++ b/block/blkverify.c >> @@ -125,7 +125,7 @@ static int blkverify_open(BlockDriverState *bs, QDict >> *options, int flags, >> const char *filename, *raw; >> int ret; >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> diff --git a/block/curl.c b/block/curl.c >> index 5a46f97..a603936 100644 >> --- a/block/curl.c >> +++ b/block/curl.c >> @@ -413,7 +413,7 @@ static int curl_open(BlockDriverState *bs, QDict >> *options, int flags, >> return -EROFS; >> } >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/block/gluster.c b/block/gluster.c >> index 877686a..563d497 100644 >> --- a/block/gluster.c >> +++ b/block/gluster.c >> @@ -298,7 +298,7 @@ static int qemu_gluster_open(BlockDriverState *bs, >> QDict *options, >> Error *local_err = NULL; >> const char *filename; >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/block/iscsi.c b/block/iscsi.c >> index a2d578c..2cec43a 100644 >> --- a/block/iscsi.c >> +++ b/block/iscsi.c >> @@ -1241,7 +1241,7 @@ static int iscsi_open(BlockDriverState *bs, QDict >> *options, int flags, >> return -EINVAL; >> } >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/block/nbd.c b/block/nbd.c >> index c8deeee..5bd9359 100644 >> --- a/block/nbd.c >> +++ b/block/nbd.c >> @@ -234,7 +234,8 @@ static int nbd_config(BDRVNBDState *s, QDict *options) >> return -EINVAL; >> } >> >> - s->socket_opts = qemu_opts_create_nofail(&socket_optslist); >> + s->socket_opts = qemu_opts_create(&socket_optslist, NULL, 0, >> + &error_abort); >> >> qemu_opts_absorb_qdict(s->socket_opts, options, &local_err); >> if (error_is_set(&local_err)) { >> diff --git a/block/qcow2.c b/block/qcow2.c >> index 6e5d98d..cf28377 100644 >> --- a/block/qcow2.c >> +++ b/block/qcow2.c >> @@ -669,7 +669,7 @@ static int qcow2_open(BlockDriverState *bs, QDict >> *options, int flags, >> } >> >> /* Enable lazy_refcounts according to image and command line options */ >> - opts = qemu_opts_create_nofail(&qcow2_runtime_opts); >> + opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> diff --git a/block/raw-posix.c b/block/raw-posix.c >> index f836c8e..dce7c27 100644 >> --- a/block/raw-posix.c >> +++ b/block/raw-posix.c >> @@ -284,7 +284,7 @@ static int raw_open_common(BlockDriverState *bs, QDict >> *options, >> const char *filename; >> int fd, ret; >> >> - opts = qemu_opts_create_nofail(&raw_runtime_opts); >> + opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> diff --git a/block/raw-win32.c b/block/raw-win32.c >> index 2bad5a3..ce314fd 100644 >> --- a/block/raw-win32.c >> +++ b/block/raw-win32.c >> @@ -248,7 +248,7 @@ static int raw_open(BlockDriverState *bs, QDict >> *options, int flags, >> >> s->type = FTYPE_FILE; >> >> - opts = qemu_opts_create_nofail(&raw_runtime_opts); >> + opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> @@ -550,7 +550,8 @@ static int hdev_open(BlockDriverState *bs, QDict >> *options, int flags, >> Error *local_err = NULL; >> const char *filename; >> >> - QemuOpts *opts = qemu_opts_create_nofail(&raw_runtime_opts); >> + QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, >> + &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> error_propagate(errp, local_err); >> diff --git a/block/rbd.c b/block/rbd.c >> index 4a1ea5b..f453f04 100644 >> --- a/block/rbd.c >> +++ b/block/rbd.c >> @@ -461,7 +461,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict >> *options, int flags, >> const char *filename; >> int r; >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/block/sheepdog.c b/block/sheepdog.c >> index ef387de..59d92a9 100644 >> --- a/block/sheepdog.c >> +++ b/block/sheepdog.c >> @@ -1375,7 +1375,7 @@ static int sd_open(BlockDriverState *bs, QDict >> *options, int flags, >> >> s->bs = bs; >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/block/vvfat.c b/block/vvfat.c >> index 3ddaa0b..f67d8ae 100644 >> --- a/block/vvfat.c >> +++ b/block/vvfat.c >> @@ -1085,7 +1085,7 @@ DLOG(if (stderr == NULL) { >> setbuf(stderr, NULL); >> }) >> >> - opts = qemu_opts_create_nofail(&runtime_opts); >> + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); >> qemu_opts_absorb_qdict(opts, options, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); >> diff --git a/blockdev.c b/blockdev.c >> index 330aa4a..78e8455 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -682,7 +682,8 @@ DriveInfo *drive_init(QemuOpts *all_opts, >> BlockInterfaceType block_default_type) >> bs_opts = qdict_new(); >> qemu_opts_to_qdict(all_opts, bs_opts); >> >> - legacy_opts = qemu_opts_create_nofail(&qemu_legacy_drive_opts); >> + legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 1, >> + &error_abort); >> qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err); >> if (error_is_set(&local_err)) { >> qerror_report_err(local_err); > > I'm afraid this one still changed fail_if_exists. >
sed stuff-up. Sorry. Fixing. Regards, Peter