From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B512714EC; Wed, 7 Nov 2018 17:30:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2018 08:30:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,475,1534834800"; d="scan'208";a="106692120" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.143]) ([10.237.220.143]) by orsmga002.jf.intel.com with ESMTP; 07 Nov 2018 08:30:06 -0800 To: Ferruh Yigit , dev@dpdk.org Cc: john.mcnamara@intel.com, stable@dpdk.org References: From: "Burakov, Anatoly" Message-ID: Date: Wed, 7 Nov 2018 16:30:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] devbind: check for lspci X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 16:30:10 -0000 On 07-Nov-18 4:01 PM, Ferruh Yigit wrote: > On 11/7/2018 1:56 PM, Anatoly Burakov wrote: >> On some distributions (such as CentOS 7) lspci may not be installed >> by default, causing exceptions which are difficult to interpret. >> >> Fix devbind script to check if lspci is installed at script startup. > > I guess we need lspci for `--status`, bind/unbind can be done without `lspci`, > what about adding check only display path? IMO it's not worth respinning over that minor detail, but if you feel strongly about it - sure, i can do a v2 with this on display path only :) > >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Anatoly Burakov >> --- >> usertools/dpdk-devbind.py | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py >> index 7d564634c..74bf514c0 100755 >> --- a/usertools/dpdk-devbind.py >> +++ b/usertools/dpdk-devbind.py >> @@ -655,6 +655,13 @@ def do_arg_actions(): >> >> def main(): >> '''program main function''' >> + # check if lspci is installed, suppress any output >> + with open(os.devnull, 'w') as devnull: >> + ret = subprocess.call(['which', 'lspci'], >> + stdout=devnull, stderr=devnull) >> + if ret != 0: >> + print("'lspci' not found - please install 'lspci'") >> + sys.exit(1) >> parse_args() >> check_modules() >> clear_data() >> > > -- Thanks, Anatoly