qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH qemu] tap: Allow specifying a bridge


From: Alexey Kardashevskiy
Subject: [Qemu-devel] [PATCH qemu] tap: Allow specifying a bridge
Date: Tue, 6 Sep 2016 20:54:49 +1000

The tap backend is already using qemu-bridge-helper to attach tap
interface to a bridge but (unlike the bridge backend) it always uses
the default bridge name - br0.

This adds a "br" property support to the tap backend.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
---

My reason for the patch is I want to use vhost on devices attached to
bridges other than br0 and since -netdev bridge ignores vhost, here is
the patch.
---
 net/tap.c        | 4 +++-
 qapi-schema.json | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/tap.c b/net/tap.c
index 6abb962..b6896a7 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -857,7 +857,9 @@ free_fail:
             return -1;
         }
 
-        fd = net_bridge_run_helper(tap->helper, DEFAULT_BRIDGE_INTERFACE,
+        fd = net_bridge_run_helper(tap->helper,
+                                   tap->has_br ?
+                                   tap->br : DEFAULT_BRIDGE_INTERFACE,
                                    errp);
         if (fd == -1) {
             return -1;
diff --git a/qapi-schema.json b/qapi-schema.json
index 5658723..508312a 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2604,6 +2604,7 @@
     '*fds':        'str',
     '*script':     'str',
     '*downscript': 'str',
+    '*br':         'str',
     '*helper':     'str',
     '*sndbuf':     'size',
     '*vnet_hdr':   'bool',
-- 
2.5.0.rc3




reply via email to

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