tap: Allow specifying a bridge

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 <aik@ozlabs.ru>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Alexey Kardashevskiy 2016-09-13 17:11:54 +10:00 committed by Jason Wang
parent fb56d323e2
commit 584613eacb
3 changed files with 13 additions and 6 deletions

View file

@ -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;