From nobody Sat Sep 21 05:53:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655241143; cv=none; d=zohomail.com; s=zohoarc; b=nDY+dPMlteRAXLiHsNHJVH9qCsrOP9t06zoEqK2NYYtd13CYG2wf9Ek4+2mGpl08Ni3S1GcIWKXVitRjrG4FeJ1iPnYBisAGGDI0tv/DvaF483dhlp/pjaAcTp6+BoYP8CFDZbJdZKxQUmxfMJ8O9t6eAcDCohtha+koYsp6x5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655241143; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=5OEPrwlGXS58p8HvgS1ILRM7xBQDf6JCfGW6ElXKY/4=; b=kWhdJyVsFEizHY01TTNkfXSEpB5Qg7j9mG/nUGKmU/WFolAmJz4HHjMRyoUJZFVXJiFJtqkya+l59Xkahbq+eqypu2W5irL/M9zL8xJ2VqbF5s/5PXvQ8sil8wTHJAO3eNUa0e8FnfVWexY7n45hfhZy3cY3IxBjimgR3nGA4oI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165524114320546.08288204458631; Tue, 14 Jun 2022 14:12:23 -0700 (PDT) Received: from localhost ([::1]:50254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Dpl-0004Yu-Nt for importer@patchew.org; Tue, 14 Jun 2022 17:12:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Dli-0005Zk-V1 for qemu-devel@nongnu.org; Tue, 14 Jun 2022 17:08:11 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:41515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Dlh-0007lF-64 for qemu-devel@nongnu.org; Tue, 14 Jun 2022 17:08:10 -0400 Received: by mail-pl1-x62c.google.com with SMTP id g8so3562788plt.8 for ; Tue, 14 Jun 2022 14:08:08 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:d5aa:1806:cce3:7773]) by smtp.gmail.com with ESMTPSA id h65-20020a62de44000000b0050dc762813csm8129456pfg.22.2022.06.14.14.08.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Jun 2022 14:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5OEPrwlGXS58p8HvgS1ILRM7xBQDf6JCfGW6ElXKY/4=; b=qSEAVT6CFgkqFdi7Jb/1VcV9K/DZtnwpHDQ56EsFUgX1CMYijXfwTjk0ow6r8VPE1v xViErMxpHM6I5LXLrE/K2pR+mFszU2x8o39tCaM97rOeudmLi674MPHufqodxmTdW7aE Idnea95DKHa77XS8YqN2CkBKMY5BywBjjLRBl1Yb63KabnPfOH7CvTHdLyqB42oXgpvr Qp94hFo57pOns2FfvOM0AXlGp/Mb/b3ovdDzlFdCSr8axX7Xd4n9BDa3ZN7TWy/XUpgf Cvl7QCsx5NXslQVpviN3QJq064qvb7E3yKEolkc6Jd8CiPfoI4vAB3hsPL3K/gruExsE JZhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5OEPrwlGXS58p8HvgS1ILRM7xBQDf6JCfGW6ElXKY/4=; b=rzQzGZq/SMx0y7Z4OjJRc5kS6ySipixl6em/phpeZ+UO7H5dGTQNiFSNbuhqPPjCFu OkAQLxYAEjdrfV4QGzi4X2gM2ZH3YcCoIeojA76o4nsuJSb2IA331k4mhh7QOrpz4cJv 7r43yZU6OAg8Q5/P8Gb+5xKBy6cg2i+6lv82RzRKXQVJzcP9S8tWCr+v6dauzK8jQTCb n/kg5FbA3vRy29DvELWoVsTiN41L6Rt03hKhD/HNsWgY54IK0vBusxRnqyr0jWVKEHz6 1LaC7gO58Ed74BiXvQZ0Xqt5frX1dD7EVekCBogqCAZYNlTxk1rw5H11IdwewqfUprSx SMkQ== X-Gm-Message-State: AJIora/+X1PJ0zQP8JY6SJ6fAqk+2xQQs+t7ftUEcxnZU+jW9sklVLcq s9jiLHa/jYM+iaBwyCYzOgg= X-Google-Smtp-Source: ABdhPJxiWu1PElqEKJ0+36/mMBHLqJb4PCBRd1kJEKpte6Ocnr0c2OQnpuhQ0qEfa6GjX+q1Lacn9Q== X-Received: by 2002:a17:902:6b89:b0:168:cf03:9e63 with SMTP id p9-20020a1709026b8900b00168cf039e63mr6162562plk.46.1655240887790; Tue, 14 Jun 2022 14:08:07 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Akihiko Odaki Subject: [PATCH v4 4/4] net: Use bundle mechanism Date: Wed, 15 Jun 2022 06:07:46 +0900 Message-Id: <20220614210746.78911-5-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220614210746.78911-1-akihiko.odaki@gmail.com> References: <20220614210746.78911-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655241143660100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- include/net/net.h | 2 +- meson.build | 8 +++++++- net/tap.c | 6 +++++- qemu-options.hx | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 523136c7acb..4a5ed27a4b7 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -228,7 +228,7 @@ NetClientState *net_hub_port_find(int hub_id); =20 #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-b= ridge-helper" #define DEFAULT_BRIDGE_INTERFACE "br0" =20 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd); diff --git a/meson.build b/meson.build index e7b385eaf34..72d006f228e 100644 --- a/meson.build +++ b/meson.build @@ -1686,7 +1686,7 @@ config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', ge= t_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('prefix= ') / get_option('qemu_firmwarepath')) -config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') = / get_option('libexecdir')) +config_host_data.set_quoted('CONFIG_QEMU_BUNDLE_HELPERDIR', get_option('li= bexecdir')) 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('prefi= x') / get_option('localstatedir')) @@ -3573,6 +3573,12 @@ if have_tools dependencies: [authz, crypto, io, qom, qemuutil, libcap_ng, mpathpersist], install: true) + + run_command('mkdir', '-p', qemu_bundledir / get_option('libexecdir'), + check: true) + + run_command('ln', '-sf', '../../qemu-bridge-helper', qemu_bundledir / = get_option('libexecdir'), + check: true) endif =20 if have_ivshmem diff --git a/net/tap.c b/net/tap.c index b3ddfd4a74b..ea013ca3873 100644 --- a/net/tap.c +++ b/net/tap.c @@ -507,7 +507,11 @@ static int net_bridge_run_helper(const char *helper, c= onst char *bridge, sigprocmask(SIG_BLOCK, &mask, &oldmask); =20 if (!helper) { - helper =3D default_helper =3D get_relocated_path(DEFAULT_BRIDGE_HE= LPER); + helper =3D default_helper =3D find_bundle(DEFAULT_BUNDLE_BRIDGE_HE= LPER); + if (!helper) { + error_setg(errp, "bridge helper not found"); + return -1; + } } =20 if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) =3D=3D -1) { diff --git a/qemu-options.hx b/qemu-options.hx index 377d22fbd82..1959db01061 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2665,7 +2665,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " to configure it and 'dfile' (default=3D" DEFAULT_NETW= ORK_DOWN_SCRIPT ")\n" " to deconfigure it\n" " use '[down]script=3Dno' to disable script execution\n" - " use network helper 'helper' (default=3D" DEFAULT_BRID= GE_HELPER ") to\n" + " use network helper 'helper' (default=3D" DEFAULT_BUND= LE_BRIDGE_HELPER ") to\n" " configure it\n" " use 'fd=3Dh' to connect to an already opened TAP inte= rface\n" " use 'fds=3Dx:y:...:z' to connect to already opened mu= ltiqueue capable TAP interfaces\n" @@ -2684,7 +2684,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, "-netdev bridge,id=3Dstr[,br=3Dbridge][,helper=3Dhelper]\n" " configure a host TAP network backend with ID 'str' th= at is\n" " connected to a bridge (default=3D" DEFAULT_BRIDGE_INT= ERFACE ")\n" - " using the program 'helper (default=3D" DEFAULT_BRIDGE= _HELPER ")\n" + " using the program 'helper (default=3D" DEFAULT_BUNDLE= _BRIDGE_HELPER ")\n" #endif #ifdef __linux__ "-netdev l2tpv3,id=3Dstr,src=3Dsrcaddr,dst=3Ddstaddr[,srcport=3Dsrcpor= t][,dstport=3Ddstport]\n" --=20 2.32.1 (Apple Git-133)