[dpdk-dev] [PATCH v1 1/7] examples/power: add checks around hypervisor

Hunt, David david.hunt at intel.com
Wed Sep 12 12:53:35 CEST 2018


Hi Stephen,


On 30/8/2018 5:59 PM, Stephen Hemminger wrote:
> On Thu, 30 Aug 2018 11:54:16 +0100
> David Hunt <david.hunt at intel.com> wrote:
>
> Minor nits
>
>> +static unsigned int global_hypervisor_available;
> Please use bool for boolean values.

Will change in next revision.


>>   /*
>>    * 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.

Fixed in next version.

>
> I know this is pre-existing, but please don't use CamelCase:
>
> +		if (virNodeGetInfo(global_vir_conn_ptr, &info)) {

Unfortunately I've no control over this, it's part of the libvirt API.

Thanks,
Dave.



More information about the dev mailing list