Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751332AbdHaUVu (ORCPT ); Thu, 31 Aug 2017 16:21:50 -0400 Received: from mail-bn3nam01on0139.outbound.protection.outlook.com ([104.47.33.139]:1994 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750972AbdHaUVs (ORCPT ); Thu, 31 Aug 2017 16:21:48 -0400 From: KY Srinivasan To: Eduardo Otubo CC: Haiyang Zhang , Stephen Hemminger , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , Stephen Hemminger , David Miller Subject: RE: [PATCHv2] hv_set_ifconfig.sh double check before setting ip Thread-Topic: [PATCHv2] hv_set_ifconfig.sh double check before setting ip Thread-Index: AQHTH+Sg2sqCExznaUONoTHjUfe0jaKZ4W8AgAALRQCAAA2u0IAEKMqAgADHvEA= Date: Thu, 31 Aug 2017 20:21:45 +0000 Message-ID: References: <20170828100121.17321-1-otubo@redhat.com> <20170828081624.16a1e4de@xeon-e3> <20170831081643.GA2491@vader> In-Reply-To: <20170831081643.GA2491@vader> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:2::254] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR21MB0699;6:SS9Lk0oTeVKmFmCCiuvLHiNgyt9FCcUr5/IVYS7oo3q+oOLOWc3TLmWwyAU5PDrSTvdwSfDFPGkAlBzjm+i3dDap/V3V5lWC8Q5YhzPkJPxyd+TBQyheAo/x1W9BS4bprXqKFR49+YNMW3AzzC+l5griXMENRzhpkNSsWWASjSlTtjPMy/fDN58YPgyYj+1SDzoEMcxaM3TOZBHPDJaMknt7bI2OYLV+sWRIYmyI9QOn3POv/cqdBRVag444pw+DaN73/aCvDNOgQ7SujwCeN7FFk8L8/4fv4TWNEUeZWL0C5nwDP5tUM8BgxQQ52kiOF5PLKHVeFH3Pkr4oxmDmQg==;5:oezG7Vl9Zte7gxBtWtUeJcPTxqgYs+8w/3+QKYDT3OOPmB67Ywq2GsflLRgnOTZbVaOHEzc9XerbkkY0hpY3DOGNYLbn6PDewE2S8ap4MG5shU/DZvQBYAhxc/mihy37Tii3tS5y/iny7NliL+Fd5A==;24:CdOL2vq2TqvLiARoohw7AmFHAWj+l7P/B+O2dFi7KBIjagGFmJtXj76leTjShEUx621BH6pOyaAL8VH1x2rdkMU3rCS21/F52FYcMCmIZSk=;7:27zjePvdI5lPZ8WbxuwrHujoDaFQIt31fkwU+taOQbwW7A8qljyAX3G45GSsSmdCdYIKKOmpozwzmHUcI8xc/GNHl5GqEdwHgTGx10/HjMuLaFeQjRm7q7w2HtKWoBvPKcitoLOB9kQIGKzA0gjN7HgQ1e0abUlGBrNQn34bWXMeAD9nWvLKY0wpjH0yZz4736e5tXoEv3rOIV9V+nI+jUyUfM+hL/hA5UdM/h4aE3U= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2e4c29ab-a917-47e1-eec7-08d4f0ade6f0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR21MB0699; x-ms-traffictypediagnostic: DM5PR21MB0699: x-exchange-antispam-report-test: UriScan:(89211679590171)(9452136761055); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041248)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR21MB0699;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR21MB0699; x-forefront-prvs: 04163EF38A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(189002)(377454003)(13464003)(24454002)(199003)(81156014)(106356001)(8676002)(2906002)(102836003)(6116002)(6436002)(5660300001)(86362001)(189998001)(4326008)(2900100001)(68736007)(86612001)(7696004)(6506006)(10290500003)(8990500004)(77096006)(74316002)(2950100002)(5005710100001)(229853002)(93886005)(478600001)(6916009)(54356999)(9686003)(76176999)(50986999)(54906002)(99286003)(101416001)(33656002)(55016002)(10090500001)(3660700001)(53936002)(14454004)(3280700002)(7736002)(25786009)(53546010)(305945005)(6246003)(8936002)(105586002)(81166006)(110136004)(97736004);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR21MB0699;H:DM5PR21MB0476.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; authentication-results: spf=none (sender IP is ) smtp.mailfrom=kys@microsoft.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2017 20:21:45.9077 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0699 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v7VKLt3n022218 Content-Length: 3679 Lines: 90 > -----Original Message----- > From: Eduardo Otubo [mailto:otubo@redhat.com] > Sent: Thursday, August 31, 2017 1:17 AM > To: KY Srinivasan > Cc: Haiyang Zhang ; Stephen Hemminger > ; linux-kernel@vger.kernel.org; > devel@linuxdriverproject.org; Stephen Hemminger > ; David Miller > Subject: Re: [PATCHv2] hv_set_ifconfig.sh double check before setting ip > > On Mon, Aug 28, 2017 at 04:48:32PM +0000, KY Srinivasan wrote: > > > > > > > -----Original Message----- > > > From: Haiyang Zhang > > > Sent: Monday, August 28, 2017 8:57 AM > > > To: Stephen Hemminger ; Eduardo > Otubo > > > ; KY Srinivasan > > > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; Stephen > > > Hemminger ; David Miller > > > > > > Subject: RE: [PATCHv2] hv_set_ifconfig.sh double check before setting ip > > > > > > > > > > > > > -----Original Message----- > > > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > > > Sent: Monday, August 28, 2017 11:16 AM > > > > To: Eduardo Otubo > > > > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; > Haiyang > > > > Zhang ; Stephen Hemminger > > > > ; David Miller > > > > Subject: Re: [PATCHv2] hv_set_ifconfig.sh double check before setting > ip > > > > > > > > On Mon, 28 Aug 2017 12:01:21 +0200 > > > > Eduardo Otubo wrote: > > > > > > > > > v2: The script is now a little bit safer so it doesn't conflicts with > > > > > network daemon trying to set configurations at the same time. > > > > > > > > > > This patch fixes the behavior of the hv_set_ifconfig script when > > > > setting > > > > > the interface ip. Sometimes the interface has already been > configured > > > > by > > > > > network daemon, in this case hv_set_ifconfig causes "RTNETLINK: file > > > > > exists error"; in order to avoid this error this patch makes sure > > > > double > > > > > checks the interface before trying anything. > > > > > > > > > > Signed-off-by: Eduardo Otubo > > > > > > > > Adding new dependency on systemd is not going to make this script > > > > even less useful. I wonder why the script still exists at all? Most of > > > > the > > > > Linux distro's can already setup HV networking without it. > > > > > > > > > > This script is used by a host to inject IP into guests. KY knows more > > > details about it. > > > > I wrote this script initially to provide an example script for Distros to base > their solution on. > > KVP supports IP injection to enable VM migration. For this scenario, I think > we recommend that NM be > > disabled. > > > > So, what you're saying is that this should be fixed downstream, > instead? This solution seems pretty safe for me and long term we can > think about something else that could get rid of this script. So NM or > whatever is in use can actually do the configuration. > > Any chance to have this patch ACK'd as a form of a short term > solution? Given that this is just an example script to be customized on a per Distro basis, do you still see value in making this change upstream. In any case, as Olaf noted the delay will cause problems. One option would be to simply fail if network scripts are running. As you say, if you are making sure that the KVP daemon is only run after the network script have executed, this restriction (failing if the scripts are active) should not be an issue. Regards, K. Y