[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 7/8] tools/xenalyze: Fix multiple instances of *HYPERCALL_MAX



On 26/02/16 12:33, Ian Jackson wrote:
> George Dunlap writes ("[PATCH 7/8] tools/xenalyze: Fix multiple instances of 
> *HYPERCALL_MAX"):
>> We HYPERCALL_MAX defined as the maximum enumerated hypercall, and we
>     ^ missing word `have' ?
> 
>> have PV_HYPERCALL_MAX defined as some other number (presumably based
>> on experience with actual hypercalls).  Both are used to size arrays
>> (hypercall_name[] and pv_data.hypercall_count[], respectively).
>>
>> Rename PV_HYPERCALL_MAX to HYPERCALL_MAX, and use HYPERCALL_MAX to
>> size (and iterate over) all arrays.
> ...
>> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
>> index 3e26a4c..4ae50b8 100644
>> --- a/tools/xentrace/xenalyze.c
>> +++ b/tools/xentrace/xenalyze.c
>> @@ -1068,9 +1068,10 @@ enum {
>>      HYPERCALL_sysctl,
>>      HYPERCALL_domctl,
>>      HYPERCALL_kexec_op,
>> -    HYPERCALL_MAX
>>  };
>>  
>> +#define HYPERCALL_MAX 38
>> +
>>  char *hypercall_name[HYPERCALL_MAX] = {
>>      [HYPERCALL_set_trap_table]="set_trap_table",
>>      [HYPERCALL_mmu_update]="mmu_update",
>> @@ -1509,13 +1510,12 @@ char *pv_name[PV_MAX] = {
>>      [PV_HYPERCALL_SUBCALL]="hypercall (subcall)",
> 
> Does this produce a build error if HYPERCALL_MAX is too small ?

You mean, if it's smaller than at least one of the indexes in the array
initialization immediately following?  Yes. (I just tested it to be sure.)

 -G


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.