From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v1 1/7] examples/power: add checks around hypervisor Date: Thu, 30 Aug 2018 09:59:39 -0700 Message-ID: <20180830095535.1548db4f@xeon-e3> 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 Cc: dev@dpdk.org, john.mcnamara@intel.com To: David Hunt 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) In-Reply-To: <20180830105422.1198-2-david.hunt@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)) {