diff options
-rw-r--r-- | qemu-option.c | 9 | ||||
-rw-r--r-- | qemu-option.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/qemu-option.c b/qemu-option.c index e0131ce7b1..1303188dbd 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -780,6 +780,15 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, return opts; } +QemuOpts *qemu_opts_create_nofail(QemuOptsList *list) +{ + QemuOpts *opts; + Error *errp = NULL; + opts = qemu_opts_create(list, NULL, 0, &errp); + assert_no_error(errp); + return opts; +} + void qemu_opts_reset(QemuOptsList *list) { QemuOpts *opts, *next_opts; diff --git a/qemu-option.h b/qemu-option.h index ca729862d5..b0f8d1ecd6 100644 --- a/qemu-option.h +++ b/qemu-option.h @@ -133,6 +133,7 @@ int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque, QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id); QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists, Error **errp); +QemuOpts *qemu_opts_create_nofail(QemuOptsList *list); void qemu_opts_reset(QemuOptsList *list); void qemu_opts_loc_restore(QemuOpts *opts); int qemu_opts_set(QemuOptsList *list, const char *id, |