Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp94939lqt; Thu, 18 Apr 2024 09:16:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+R/7EAnQANVxCrQa3TOMgqruXp9gaqwcvbML93HPnU/MOOkAz9NbAG9zfBJIjjN5d35nhYUYsr7gCKewgtetRVnY3MRzP7V4QoVt2NA== X-Google-Smtp-Source: AGHT+IHviOcB2IqkypSYFHrTwihMSDq+c8YykdXaYhZ6FaQfFfDoFM9SKNxRrnVACI6t35UC+sR1 X-Received: by 2002:a05:651c:b1e:b0:2d6:8e88:5a8b with SMTP id b30-20020a05651c0b1e00b002d68e885a8bmr3048693ljr.32.1713456980241; Thu, 18 Apr 2024 09:16:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713456980; cv=pass; d=google.com; s=arc-20160816; b=c/OqgAjWI2vyUWfCmyd3h4tmNO+URHREmpXSmaEGw4RxffcHyJQoeWx5xUNP26vEsf HPY7kYl099FAYkPE/SJhe3NpTWl1K3uWFtWndxWMkTTyOQg9+XhGCOwbF1ySebIRhn8I gfTvGVpM7htGyxNfJBFuJTdUCy93GOSEvQX6SwiN5FJrf/Z3rv7hLbCAd8gSmyGvNx8s czIWkQKA00MUstLctR/WVHva4dqtD5fc7NRHdv+U59YxPHHDmvgflEzMiTf4SMed343v iXJjD/jODVhvBb5hg9sa4RnZrluNwltRfsqbgMxfoRD9+YtjlVSDBh7ejujsDg+wvrTw ZHGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=MWOwTVDiu4K6YbjXv7uAPQpvbdgODgAb4GN8I5OuR7k=; fh=ltrG1e3E2DYskWU02LEjSmrwuZltWRv4dAvOYESDMtQ=; b=LQf/tm+nK9O4AT588s0dFz0Itqb7koOqniXb1le3Z8388lBssRw7gHMjSA9JDSj0ON TOB8CeIj++ZbdXawwfJ7aqf82sChs23K3ttYEFSAuhMkOCfsj2fi3nkIbIKOAKOZ120i Ev6O9XPpcLMY1Z1i7yJScLP5FyzQph8sOA3jaHB4GclBQO7Ef6sQtrJ4Sn4gI1VlnkOW ojbZNJgQDlBoNKSNSYSMDK/7NWrR90wzw0FV1h8ahhRNs1qqw05zlnUBmu0RwEhI/9xl CqXZWaie/vnFwjydsK+T0A644xwJD56uGdBD+JXxo+2MtFaQYZsAFc2A0ZibOTjPsbza 3rIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="I+DPm/06"; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-150470-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150470-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w16-20020aa7d290000000b0056e6b4ea654si1050681edq.110.2024.04.18.09.16.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 09:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150470-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="I+DPm/06"; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-150470-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150470-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E87181F23C07 for ; Thu, 18 Apr 2024 16:16:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7779416FF45; Thu, 18 Apr 2024 16:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="I+DPm/06" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5900016FF48; Thu, 18 Apr 2024 16:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713456952; cv=none; b=mMJnwIOd50dKoJm7xlhEwPABUvF84S3nFQb2GvY6t2RrADnjt163Rst/lhsnR7JVM1qGMNvSSogzbOL7O40td7jSKE4S0/qpiGbp3CyBr8yMiyn2fDCoUuE1iHgwabRZXu62S17DvofKSeCUlgoedaKHs8c5sZizSB6RgKWmb/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713456952; c=relaxed/simple; bh=dzWJk/AKNpODHXz+qqTZXgmHW+ImAxMS1UX+Qpbdyzs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JBlABd60j9gaIPIa2NmTXRWXFqwn58PpXYL7bqAiAnOuawY8JRILpPSF+zHHYB9YYZ2HXFoA+Om3R/RmkDYh6r9x2H5UPvexNEEELP/8V4OPdpipKKYTp+akvjoWOAneeptzjbSEKlsnUSLtVSrLeo1v7mFaUzl4NWlanBp65U4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=I+DPm/06; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: from [100.72.0.75] (unknown [20.236.11.102]) by linux.microsoft.com (Postfix) with ESMTPSA id 68A3720FD8C4; Thu, 18 Apr 2024 09:15:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 68A3720FD8C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713456950; bh=MWOwTVDiu4K6YbjXv7uAPQpvbdgODgAb4GN8I5OuR7k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=I+DPm/062TYCzU2rLwp0nsTAu4f1ZG79Rs0Uj/5pNupY+3mNAjWZRjiFTSAENC9Iq VXPb6a2PeNZh8WAQpPYFlepFy8DlJ8URIU2irBFW5umkNrYJvwXbvqoK1PnVnj+rtk ugrDiMk2lGJyxvNgL+8z/W/SlyQRHWJ5gqyvIx7E= Message-ID: <19df975d-167f-424a-92ce-5135cbeb8a07@linux.microsoft.com> Date: Thu, 18 Apr 2024 09:15:51 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] Add a header in ifcfg and nm keyfiles describing the owner of the files To: Ani Sinha , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui Cc: shradhagupta@linux.microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240418120549.59018-1-anisinha@redhat.com> Content-Language: en-CA From: Easwar Hariharan In-Reply-To: <20240418120549.59018-1-anisinha@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/18/2024 5:05 AM, Ani Sinha wrote: > A comment describing the source of writing the contents of the ifcfg and > network manager keyfiles (hyperv kvp daemon) is useful. It is valuable both > for debugging as well as for preventing users from modifying them. > > CC: shradhagupta@linux.microsoft.com > CC: eahariha@linux.microsoft.com > CC: wei.liu@kernel.org > Signed-off-by: Ani Sinha > --- > tools/hv/hv_kvp_daemon.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > changelog: > v2: simplify and fix issues with error handling. > > diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c > index ae57bf69ad4a..014e45be6981 100644 > --- a/tools/hv/hv_kvp_daemon.c > +++ b/tools/hv/hv_kvp_daemon.c > @@ -94,6 +94,8 @@ static char *lic_version = "Unknown version"; > static char full_domain_name[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; > static struct utsname uts_buf; > > +#define CFG_HEADER "# Generated by hyperv key-value pair daemon. Please do not modify.\n" > + > /* > * The location of the interface configuration file. > */ > @@ -1435,6 +1437,18 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val) > return HV_E_FAIL; > } > > + /* Write the config file headers */ > + error = fprintf(ifcfg_file, CFG_HEADER); > + if (error < 0) { > + error = HV_E_FAIL; > + goto setval_error; > + } > + error = fprintf(nmfile, CFG_HEADER); > + if (error < 0) { > + error = HV_E_FAIL; > + goto setval_error; > + } > + > /* > * First write out the MAC address. > */ Looks good to me, I'll defer to other folks on the recipient list on whether "hyperv" should be capitalized as HyperV or other such feedback. Reviewed-by: Easwar Hariharan Thanks, Easwar