aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-03-06 10:39:24 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2014-04-27 13:04:18 +0400
commite96e5ae880f0e5d4d372264e2a5cb91cba40f771 (patch)
tree2c07bec4d88ca17e1ddc2e46382e5a0d951d5588 /util
parenteb6282f230b75eca057dd3b3027f1bfa100bef9c (diff)
qemu-option: introduce qemu_find_opts_singleton
Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/qemu-config.c b/util/qemu-config.c
index f6101012c0..60051dfed4 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -39,6 +39,20 @@ QemuOptsList *qemu_find_opts(const char *group)
return ret;
}
+QemuOpts *qemu_find_opts_singleton(const char *group)
+{
+ QemuOptsList *list;
+ QemuOpts *opts;
+
+ list = qemu_find_opts(group);
+ assert(list);
+ opts = qemu_opts_find(list, NULL);
+ if (!opts) {
+ opts = qemu_opts_create(list, NULL, 0, &error_abort);
+ }
+ return opts;
+}
+
static CommandLineParameterInfoList *query_option_descs(const QemuOptDesc *desc)
{
CommandLineParameterInfoList *param_list = NULL, *entry;