[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/8] qapi: support implicit structs in OptsVisito
From: |
Kővágó, Zoltán |
Subject: |
[Qemu-devel] [PATCH v3 1/8] qapi: support implicit structs in OptsVisitor |
Date: |
Thu, 18 Jun 2015 18:43:43 +0200 |
They are required for flat unions (you still have to allocate the
structs).
Signed-off-by: Kővágó, Zoltán <address@hidden>
---
qapi/opts-visitor.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index f2ad6d7..f02059d 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -149,6 +149,12 @@ opts_start_struct(Visitor *v, void **obj, const char *kind,
}
}
+static void
+opts_start_implicit_struct(Visitor *v, void **obj, size_t size, Error **errp)
+{
+ opts_start_struct(v, obj, NULL, NULL, size, errp);
+}
+
static gboolean
ghr_true(gpointer ign_key, gpointer ign_value, gpointer ign_user_data)
@@ -185,6 +191,12 @@ opts_end_struct(Visitor *v, Error **errp)
ov->fake_id_opt = NULL;
}
+static void
+opts_end_implicit_struct(Visitor *v, Error **errp)
+{
+ opts_end_struct(v, errp);
+}
+
static GQueue *
lookup_distinct(const OptsVisitor *ov, const char *name, Error **errp)
@@ -508,6 +520,9 @@ opts_visitor_new(const QemuOpts *opts)
ov->visitor.start_struct = &opts_start_struct;
ov->visitor.end_struct = &opts_end_struct;
+ ov->visitor.start_implicit_struct = &opts_start_implicit_struct;
+ ov->visitor.end_implicit_struct = &opts_end_implicit_struct;
+
ov->visitor.start_list = &opts_start_list;
ov->visitor.next_list = &opts_next_list;
ov->visitor.end_list = &opts_end_list;
--
2.4.3
- [Qemu-devel] [PATCH v3 0/8] -audiodev option, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 2/8] qapi: convert NumaOptions into a flat union, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 4/8] qapi: qapi for audio backends, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 1/8] qapi: support implicit structs in OptsVisitor,
Kővágó, Zoltán <=
- [Qemu-devel] [PATCH v3 6/8] opts: produce valid command line in qemu_opts_print, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 5/8] qapi: support nested structs in OptsVisitor, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 7/8] audio: use qapi AudioFormat instead of audfmt_e, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a flat union, Kővágó, Zoltán, 2015/06/18
- [Qemu-devel] [PATCH v3 8/8] audio: -audiodev command line option, Kővágó, Zoltán, 2015/06/18