[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL V2 16/27] tap: Allow specifying a bridge
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL V2 16/27] tap: Allow specifying a bridge |
Date: |
Tue, 27 Sep 2016 18:12:56 +0800 |
From: Alexey Kardashevskiy <address@hidden>
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>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Greg Kurz <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
net/tap.c | 4 +++-
qapi-schema.json | 3 +++
qemu-options.hx | 12 +++++++-----
3 files changed, 13 insertions(+), 6 deletions(-)
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 e507061..c3dcf11 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2636,6 +2636,8 @@
#
# @downscript: #optional script to shut down the interface
#
+# @br: #optional bridge name (since 2.8)
+#
# @helper: #optional command to execute to configure bridge
#
# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
@@ -2665,6 +2667,7 @@
'*fds': 'str',
'*script': 'str',
'*downscript': 'str',
+ '*br': 'str',
'*helper': 'str',
'*sndbuf': 'size',
'*vnet_hdr': 'bool',
diff --git a/qemu-options.hx b/qemu-options.hx
index 987d055..01f01df 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1598,10 +1598,11 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
" configure a host TAP network backend with ID 'str'\n"
#else
"-netdev
tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
- "
[,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
+ "
[,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
"
[,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
" [,poll-us=n]\n"
" configure a host TAP network backend with ID 'str'\n"
+ " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE
")\n"
" use network scripts 'file' (default="
DEFAULT_NETWORK_SCRIPT ")\n"
" to configure it and 'dfile' (default="
DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
" to deconfigure it\n"
@@ -1888,8 +1889,8 @@ processed and applied to -net user. Mixing them with the
new configuration
syntax gives undefined results. Their use for new applications is discouraged
as they will be removed from future versions.
address@hidden -netdev
tap,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden
address@hidden -net
tap[,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden
address@hidden -netdev
tap,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden
address@hidden -net
tap[,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden
Connect the host TAP network interface @var{name} to VLAN @var{n}.
Use the network script @var{file} to configure it and the network script
@@ -1900,8 +1901,9 @@ automatically provides one. The default network configure
script is
to disable script execution.
If running QEMU as an unprivileged user, use the network helper
address@hidden to configure the TAP interface. The default network
-helper executable is @file{/path/to/qemu-bridge-helper}.
address@hidden to configure the TAP interface and attach it to the bridge.
+The default network helper executable is @file{/path/to/qemu-bridge-helper}
+and the default bridge device is @file{br0}.
@address@hidden can be used to specify the handle of an already
opened host TAP interface.
--
2.7.4
- [Qemu-devel] [PULL V2 05/27] net/colo.c: add colo.c to define and handle packet, (continued)
- [Qemu-devel] [PULL V2 05/27] net/colo.c: add colo.c to define and handle packet, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 07/27] colo-compare: track connection and enqueue packet, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 08/27] colo-compare: introduce packet comparison thread, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 09/27] colo-compare: add TCP, UDP, ICMP packet comparison, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 10/27] filter-rewriter: introduce filter-rewriter initialization, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 11/27] filter-rewriter: track connection and parse packet, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 12/27] filter-rewriter: rewrite tcp packet to keep secondary connection, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 13/27] MAINTAINERS: add maintainer for COLO-proxy, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 14/27] docs: Add documentation for COLO-proxy, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 15/27] e1000: fix buliding complaint, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 16/27] tap: Allow specifying a bridge,
Jason Wang <=
- [Qemu-devel] [PULL V2 17/27] net: limit allocation in nc_sendv_compat, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 18/27] e1000e: Flush all receive queues on receive enable, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 20/27] e1000e: Fix CTRL_EXT.EIAME behavior, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 19/27] e1000e: Flush receive queues on link up, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 21/27] e1000e: Fix PBACLR implementation, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 22/27] e1000e: Fix OTHER interrupts processing for MSI-X, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 23/27] e1000e: Fix spurious RX TCP ACK interrupts, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 24/27] e1000e: Fix EIAC register implementation, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 25/27] net: mcf: limit buffer descriptor count, Jason Wang, 2016/09/27
- [Qemu-devel] [PULL V2 26/27] mcf_fec: fix error in qemu_send_packet argument, Jason Wang, 2016/09/27