[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] qapi: support implicit structs in OptsVisitor
From: |
Kővágó, Zoltán |
Subject: |
[Qemu-devel] [PATCH 1/5] qapi: support implicit structs in OptsVisitor |
Date: |
Tue, 23 Jun 2015 15:32:57 +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 7ae33b3..aa68814 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 0/5] qapi flattening + some miscellaneous patches, Kővágó, Zoltán, 2015/06/23
- [Qemu-devel] [PATCH 2/5] qapi: convert NumaOptions into a flat union, Kővágó, Zoltán, 2015/06/23
- [Qemu-devel] [PATCH 1/5] qapi: support implicit structs in OptsVisitor,
Kővágó, Zoltán <=
- [Qemu-devel] [PATCH 5/5] opts: produce valid command line in qemu_opts_print, Kővágó, Zoltán, 2015/06/23
- [Qemu-devel] [PATCH 4/5] qapi: support nested structs in OptsVisitor, Kővágó, Zoltán, 2015/06/23
- [Qemu-devel] [PATCH 3/5] qapi: change Netdev and NetLegacy into a flat union, Kővágó, Zoltán, 2015/06/23
- Re: [Qemu-devel] [PATCH 0/5] qapi flattening + some miscellaneous patches, Gerd Hoffmann, 2015/06/25