From patchwork Tue Sep 6 10:54:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 9316369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7AE5C601C0 for ; Tue, 6 Sep 2016 10:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EC0E28C78 for ; Tue, 6 Sep 2016 10:55:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6390828C7C; Tue, 6 Sep 2016 10:55:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E854428C78 for ; Tue, 6 Sep 2016 10:55:46 +0000 (UTC) Received: from localhost ([::1]:60645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhE2b-0001Dg-Fh for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 06:55:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhE2L-0001DP-DI for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhE2H-0000GL-6h for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:55:28 -0400 Received: from ozlabs.ru ([83.169.36.222]:48676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhE2H-0000Fw-0K for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:55:25 -0400 Received: from vpl2.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 0F42B1200F3; Tue, 6 Sep 2016 12:54:51 +0200 (CEST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Tue, 6 Sep 2016 20:54:49 +1000 Message-Id: <1473159289-28824-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.5.0.rc3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.169.36.222 Subject: [Qemu-devel] [PATCH qemu] tap: Allow specifying a bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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',