From patchwork Thu Jul 8 17:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 12365817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A10CC11F66 for ; Thu, 8 Jul 2021 17:29:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01E1A616EB for ; Thu, 8 Jul 2021 17:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01E1A616EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1Xq9-0006Cy-V2 for qemu-devel@archiver.kernel.org; Thu, 08 Jul 2021 13:29:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1Xmg-0007qJ-Np for qemu-devel@nongnu.org; Thu, 08 Jul 2021 13:26:00 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:41925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1Xme-0005dP-MO for qemu-devel@nongnu.org; Thu, 08 Jul 2021 13:25:58 -0400 Received: by mail-pj1-x1032.google.com with SMTP id oj10-20020a17090b4d8ab0290172f77377ebso4329805pjb.0 for ; Thu, 08 Jul 2021 10:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M5vcKKDVZQYms4uOR9JQB2etWe+O1TO8Yu2POyfw0g0=; b=NX7UGSW1heDex1AJovAXg7y5EroxRzxoxAnCdlixyLfh2KQpbqPdiwEmmfIka8Nm7w 7JIpyZFwPt8p+z2rEE2BZqQ2os6kkDdPPyLZFI/GeVGub8Xllc9cAFsowVeWbC818PUL UYFMKkOv5yHJjuZeQ5RZoruxtNd+4XE12I5oZfV66uhPCUirIermFaV/2Booz4vEYs0T eAflu0kIF5tdFDgPeDF58DF5Yqxx3Z8MMXpmL4RzBhqY3xgViQJRshuGEb9G+ZE0Kwva CbMT/A1KR8QmP8nyOAX505EOouDSz2vDDtoJTow4GTLxbeEmooKJovTEANMuD7mCV/Yd 8fnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M5vcKKDVZQYms4uOR9JQB2etWe+O1TO8Yu2POyfw0g0=; b=lcWQfQlRIHGedGsd7T9DsN/ejqGtjeBu6mFXQupWMNGgyH5JY2AWdzrPKNNP7iyusM m3IrkHX2YC2h93Sq/yoGj9e3fqTowjbaB3dulYRzDp1+9XmLJJode8hPSCcVyo6SWGMq P6XlUViQzVamaFLSSXyOtu3XhcapRdFOfwS9fr1rSOHMa+5ZfEoBThBMsteRM1v2vbYy SQqp/pWbxcXh/rby8R6oGUt0/gxRe9DtKKMkdZcZb6Hj1Eb8J16TYzMPXpsHc3M2GhBX HXkBIhD4CPkuaw3blRZY9YGdvxWJrESS8d9wnutpwG5wVy88I/n5Vi2pCvx7zLL3oPsa c32g== X-Gm-Message-State: AOAM530d9AGWtuNLbSngFgqpAvkwlRpTDq2X05vmLwXUPirtqChw2IOL X4/tKXrPq/Ie793D087qBJVlJpHdIsJagw== X-Google-Smtp-Source: ABdhPJxIMBk6Lf81WqrzEstEOdxWev/pGnCYDOs1olR91Np1uhMj8wDiCJ5b2I6+t/w2MnIiNEbPtQ== X-Received: by 2002:a17:902:7b8c:b029:129:5733:2e3b with SMTP id w12-20020a1709027b8cb029012957332e3bmr26854128pll.4.1625765155333; Thu, 08 Jul 2021 10:25:55 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:7947:37f7:fd02:9c0c]) by smtp.gmail.com with ESMTPSA id c20sm3579429pfd.64.2021.07.08.10.25.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jul 2021 10:25:55 -0700 (PDT) From: Akihiko Odaki To: Subject: [PATCH 4/4] net: Use bundle mechanism Date: Fri, 9 Jul 2021 02:25:41 +0900 Message-Id: <20210708172541.29530-4-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20210708172541.29530-1-akihiko.odaki@gmail.com> References: <20210708172541.29530-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Akihiko Odaki --- configure | 1 + include/net/net.h | 2 +- meson.build | 1 + net/tap.c | 6 +++++- qemu-options.hx | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/configure b/configure index a9f746849ec..aa8e096faaa 100755 --- a/configure +++ b/configure @@ -5069,6 +5069,7 @@ done symlink $source_path/ui/icons/qemu.svg qemu-bundle/share/icons/hicolor/scalable/apps/qemu.svg symlink ../../pc-bios qemu-bundle/share/qemu +symlink ../../qemu-bridge-helper qemu-bundle/libexec/qemu-bridge-helper (for i in $cross_cc_vars; do export $i diff --git a/include/net/net.h b/include/net/net.h index 5d1508081f9..5f701e942b3 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -221,7 +221,7 @@ NetClientState *net_hub_port_find(int hub_id); #define DEFAULT_NETWORK_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifdown" -#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" +#define DEFAULT_BUNDLE_BRIDGE_HELPER CONFIG_QEMU_BUNDLE_HELPERDIR "/qemu-bridge-helper" #define DEFAULT_BRIDGE_INTERFACE "br0" void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd); diff --git a/meson.build b/meson.build index 6d90fe92bf1..ecfc5bd8c72 100644 --- a/meson.build +++ b/meson.build @@ -1200,6 +1200,7 @@ config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_c config_host_data.set_quoted('CONFIG_QEMU_BUNDLE_DATADIR', qemu_datadir) config_host_data.set_quoted('CONFIG_QEMU_DESKTOPDIR', get_option('prefix') / qemu_desktopdir) config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('qemu_firmwarepath')) +config_host_data.set_quoted('CONFIG_QEMU_BUNDLE_HELPERDIR', get_option('libexecdir')) config_host_data.set_quoted('CONFIG_QEMU_BUNDLE_ICONDIR', qemu_icondir) config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') / get_option('localedir')) config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') / get_option('localstatedir')) diff --git a/net/tap.c b/net/tap.c index f5686bbf771..be80f29b96b 100644 --- a/net/tap.c +++ b/net/tap.c @@ -508,7 +508,11 @@ static int net_bridge_run_helper(const char *helper, const char *bridge, sigprocmask(SIG_BLOCK, &mask, &oldmask); if (!helper) { - helper = default_helper = get_relocated_path(DEFAULT_BRIDGE_HELPER); + helper = default_helper = find_bundle(DEFAULT_BUNDLE_BRIDGE_HELPER); + if (!helper) { + error_setg(errp, "birdge helper not found"); + return -1; + } } if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) == -1) { diff --git a/qemu-options.hx b/qemu-options.hx index 8965dabc83e..2f40169e8e9 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2528,7 +2528,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" " to deconfigure it\n" " use '[down]script=no' to disable script execution\n" - " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" + " use network helper 'helper' (default=" DEFAULT_BUNDLE_BRIDGE_HELPER ") to\n" " configure it\n" " use 'fd=h' to connect to an already opened TAP interface\n" " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" @@ -2547,7 +2547,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" " configure a host TAP network backend with ID 'str' that is\n" " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" - " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" + " using the program 'helper (default=" DEFAULT_BUNDLE_BRIDGE_HELPER ")\n" #endif #ifdef __linux__ "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"