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

Re: [Xen-devel] [PATCH] libxl: memory size in kb requires 64 bit variable



On 21/07/16 17:55, Ian Jackson wrote:
> Juergen Gross writes ("[PATCH] libxl: memory size in kb requires 64 bit 
> variable"):
>> libxl_set_memory_target() and several other interface functions of
>> libxl use a 32 bit sized parameter for a memory size value in kBytes.
>> This limits the maximum size to be passed in such a parameter
>> depending on signedness of the parameter to 2TB or 4TB.
> 
> This is the right interface change, I think.  But:
> 
>> +#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
>> +
>> +static inline int libxl_get_memory_target_0x040700(
>> +    libxl_ctx *ctx, uint32_t domid, uint32_t *out_target)
>> +    LIBXL_EXTERNAL_CALLERS_ONLY
> 
> Firstly, this is rather too much to be an inline function.  It is
> perfectly permissible to m,ake one of these compatibility functions
> extern rather than inline.

Okay.

>> +    *out_target = my_out_target;
>> +    if (my_out_target != *out_target) {
>> +        LOGE(ERROR, "memory size too large for 32 bit value\n");
>> +        ret = ERROR_FAIL;
> 
> Secondly, this is rather repetitive.  I wonder if it could be made
> less so.

Sure.


Juergen


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

 


Rackspace

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