From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 934E558FE for ; Thu, 30 Aug 2018 18:59:42 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id i26-v6so4141023pfo.12 for ; Thu, 30 Aug 2018 09:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kISLkl0X9P5BP3+ygLWO73gQWpTuGbZoDRQaWGNbikQ=; b=ngt7kTuaIaT6x1XQD9yAY2jwAjFYoxdQTwGct8tPXgvi3fKW9AgYwNcLkYwa16yWFY qQs3rekl587XztKOo80yndG6yO9fizx1dGdpvbRXIJuP8cv8Sca9w99qQ3Xm1owPD9Ll JWbtDie/nw3EUq24GccNCkHzuD1/bllz4zxf4IS75L3LzM9a6NnM5qXtRqKB8xnlbzj0 SoIGUKHQezNftX0CX6PCVv136KoqzDL1oiF9MY2ThmrTSJd+ghjakLk6PdrOnd125rMC YweU2drhq9iWkGi/bin3v4MlnhOr650Cbgq/IuI5hHlZicDvX4nT0rcCqoMfJoAp9TBs ZVLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kISLkl0X9P5BP3+ygLWO73gQWpTuGbZoDRQaWGNbikQ=; b=MSQsoGAVqXBMhXPM+0wEpjX0R2Uvhmk1aBZQVWkzSV8S8OISoe1P4xMxMHp5AONg2m KoofgaoLjp2D71W316a0DEEPz5OTBRwMQWhGf/mEVrtq8RLPp8ZDlCyDmQupTKdnsGEb 4awBWGG6RvmjUyOZJKbyFszKmBtkir+WkyI6LQ1ShvOyshzFHCDZ8HYnLGeNQcjdX6L8 9kWcGUjDVYTyICNLbj74fYTRuwiAX0YNLNexMUP88DISLdCt4dxw+/FFZnhI5lljZ4ZI AvjmapmFVtOwhfMtchAHgOT9rml4nNCE9Pr64yOKtVirk5UuF+n7aaymqc1fzBdjhasy Tnfw== X-Gm-Message-State: APzg51BizgeP80m02ghDI9wxiIbtM0hQWNv9xdTefT1DrzfMcAhkeOJ1 8l/+r0YsVUAUNCqbVWISeXYCww== X-Google-Smtp-Source: ANB0VdZhNChvkX6dnv+dMJSe/MY4v1RCzRY/O3bUN4N6Aq62VSFHe1pXNnJMwx8LvRQk5Z5AXNSKhA== X-Received: by 2002:a63:6b03:: with SMTP id g3-v6mr8361963pgc.57.1535648381728; Thu, 30 Aug 2018 09:59:41 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q26-v6sm26184131pfj.127.2018.08.30.09.59.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 09:59:41 -0700 (PDT) Date: Thu, 30 Aug 2018 09:59:39 -0700 From: Stephen Hemminger To: David Hunt Cc: dev@dpdk.org, john.mcnamara@intel.com Message-ID: <20180830095535.1548db4f@xeon-e3> In-Reply-To: <20180830105422.1198-2-david.hunt@intel.com> References: <20180830105422.1198-1-david.hunt@intel.com> <20180830105422.1198-2-david.hunt@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1 1/7] examples/power: add checks around hypervisor 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: Thu, 30 Aug 2018 16:59:42 -0000 On Thu, 30 Aug 2018 11:54:16 +0100 David Hunt wrote: Minor nits > +static unsigned int global_hypervisor_available; Please use bool for boolean values. > /* > * Represents a single Virtual Machine > @@ -198,7 +199,11 @@ get_pcpus_mask(struct channel_info *chan_info, unsigned vcpu) > { > struct virtual_machine_info *vm_info = > (struct virtual_machine_info *)chan_info->priv_info; > - return rte_atomic64_read(&vm_info->pcpu_mask[vcpu]); > + > + if ((global_hypervisor_available) && (vm_info != NULL)) parenthesis are unnecessary here. I know this is pre-existing, but please don't use CamelCase: + if (virNodeGetInfo(global_vir_conn_ptr, &info)) {