From nobody Fri May 17 11:05:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1646127346134141.06712940181512; Tue, 1 Mar 2022 01:35:46 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.281047.479211 (Exim 4.92) (envelope-from ) id 1nOyub-000862-2s; Tue, 01 Mar 2022 09:35:17 +0000 Received: by outflank-mailman (output) from mailman id 281047.479211; Tue, 01 Mar 2022 09:35:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nOyua-00085v-WA; Tue, 01 Mar 2022 09:35:16 +0000 Received: by outflank-mailman (input) for mailman id 281047; Tue, 01 Mar 2022 09:35:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nOyuZ-00085p-PA for xen-devel@lists.xenproject.org; Tue, 01 Mar 2022 09:35:15 +0000 Received: from smarthost01a.sbp.mail.zen.net.uk (smarthost01a.sbp.mail.zen.net.uk [212.23.1.1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e5d286bd-9942-11ec-8539-5f4723681683; Tue, 01 Mar 2022 10:35:14 +0100 (CET) Received: from [217.155.64.189] (helo=mail0.xen.dingwall.me.uk) by smarthost01a.sbp.mail.zen.net.uk with esmtpsa (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1nOyuY-00071n-54; Tue, 01 Mar 2022 09:35:14 +0000 Received: from localhost (localhost [IPv6:::1]) by mail0.xen.dingwall.me.uk (Postfix) with ESMTP id 93F462EE67F; Tue, 1 Mar 2022 09:35:13 +0000 (GMT) Received: from mail0.xen.dingwall.me.uk ([127.0.0.1]) by localhost (mail0.xen.dingwall.me.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zaf6TsOvbNxP; Tue, 1 Mar 2022 09:35:13 +0000 (GMT) Received: from ghoul.dingwall.me.uk (ghoul.dingwall.me.uk [IPv6:2a02:8010:698e:302::c0a8:1c8]) by dingwall.me.uk (Postfix) with ESMTP id 739732EE67C; Tue, 1 Mar 2022 09:35:13 +0000 (GMT) Received: by ghoul.dingwall.me.uk (Postfix, from userid 1000) id 5FCF42E; Tue, 1 Mar 2022 09:35:13 +0000 (GMT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e5d286bd-9942-11ec-8539-5f4723681683 X-Virus-Scanned: Debian amavisd-new at dingwall.me.uk Date: Tue, 1 Mar 2022 09:35:13 +0000 From: James Dingwall To: xen-devel@lists.xenproject.org Cc: pdurrant@amazon.com Subject: [PATCH] fix invalid frontend path for set_mtu Message-ID: <20220301093513.GA3187840@dingwall.me.uk> MIME-Version: 1.0 Content-Disposition: inline X-Originating-smarthost01a-IP: [217.155.64.189] Feedback-ID: 217.155.64.189 X-ZM-MESSAGEID: 1646127347908100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi, The set_mtu() function of xen-network-common.sh currently has this code: if [ ${type_if} =3D vif ] then local dev_=3D${dev#vif} local domid=3D${dev_%.*} local devid=3D${dev_#*.} local FRONTEND_PATH=3D"/local/domain/$domid/device/vif/$devid" xenstore_write "$FRONTEND_PATH/mtu" ${mtu} fi This works fine if the device has its default name but if the xen config defines the vifname parameter the FRONTEND_PATH is incorrectly constructed. Learn the frontend path by reading the appropriate value from the backend. diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linu= x/xen-network-common.sh index 02e2388600..cd98f0d486 100644 Reviewed-by: Anthony PERARD --- a/tools/hotplug/Linux/xen-network-common.sh +++ b/tools/hotplug/Linux/xen-network-common.sh @@ -163,11 +163,7 @@ set_mtu () { =20 if [ ${type_if} =3D vif ] then - local dev_=3D${dev#vif} - local domid=3D${dev_%.*} - local devid=3D${dev_#*.} - - local FRONTEND_PATH=3D"/local/domain/$domid/device/vif/$devid" + local FRONTEND_PATH=3D$(xenstore_read "$XENBUS_PATH/frontend") =20 xenstore_write "$FRONTEND_PATH/mtu" ${mtu} fi Thanks, James