aboutsummaryrefslogtreecommitdiff
path: root/qemu-option.c
diff options
context:
space:
mode:
authorDong Xu Wang <wdongxu@linux.vnet.ibm.com>2012-12-06 14:47:21 +0800
committerKevin Wolf <kwolf@redhat.com>2012-12-11 16:34:45 +0100
commitdd39244978627e41a66b98d20eceddb1d7d25def (patch)
tree45ff9ebacf37d37d155e598b62232c3cb73344cb /qemu-option.c
parentad718d01ba0af531d10b0a8685cf5047edfd1891 (diff)
introduce qemu_opts_create_nofail function
While id is NULL, qemu_opts_create can not fail, so ignore errors is fine. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-option.c')
-rw-r--r--qemu-option.c9
1 files changed, 9 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;