qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v4 27/29] qapi: Change Netdev into a flat un


From: Yang Hongyang
Subject: Re: [Qemu-devel] [PATCH RFC v4 27/29] qapi: Change Netdev into a flat union
Date: Fri, 18 Sep 2015 17:03:03 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0



On 09/18/2015 04:11 AM, Eric Blake wrote:
On 09/17/2015 08:34 AM, Eric Blake wrote:


I apply Markus's v8 patch and this series, make check will fail:
TEST: tests/virtio-net-test... (pid=23648)
   /x86_64/virtio/net/pci/basic:                                        
qemu-system-x86_64: -netdev socket,fd=6,id=hs0: Invalid parameter 'fd'

Oh dear. I guess I was focused on 'make check-qapi-schema', and forgot
to test the rest of the suite.  The bug is most likely in my patches,
and will be fixed by the time I post v5, now that you've pointed it out
to me.

Fix is simple: add this patch to your build:

https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01650.html

I've rebased my git repo accordingly for now, and will post v5 later on
(I'm still working on other improvements, and may reshuffle patches
before actually getting to v5).

git fetch git://repo.or.cz/qemu/ericb.git qapi
http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi

I have to add a workaround in my previous netfilter v9 patchset(v10 and later
changed to QOM, so it won't have the problem) to get flat union work. Seems that
you have already fixed it.

diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 7ae33b3..1271fab 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -186,6 +186,20 @@ opts_end_struct(Visitor *v, Error **errp)
 }


+static void opts_start_implicit_struct(Visitor *v, void **obj,
+                                       size_t size, Error **errp)
+{
+    if (obj) {
+        *obj = g_malloc0(size);
+    }
+}
+
+
+static void opts_end_implicit_struct(Visitor *v, Error **errp)
+{
+}
+
+
 static GQueue *
 lookup_distinct(const OptsVisitor *ov, const char *name, Error **errp)
 {
@@ -507,6 +521,8 @@ 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;



--
Thanks,
Yang.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]