[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] libxl: memory size in kb requires 64 bit variable
On Fri, 2016-07-22 at 08:53 +0200, Juergen Gross wrote: > 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. > > Correct this by using 64 bit types. > > Signed-off-by: Juergen Gross <jgross@xxxxxxxx> > Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx> Entirely out of folklore, it seems to me that this function... > @@ -5057,8 +5057,28 @@ out: > return rc; > } > > +static int libxl__memkb_32to64(libxl_ctx *ctx, int rc, > + uint64_t val64, uint32_t *ptr32) > +{ > + GC_INIT(ctx); > + > + if (rc) > + goto out; > + > + *ptr32 = val64; > + if (*ptr32 == val64) > + goto out; > + > + LOGE(ERROR, "memory size %"PRIu64" too large for 32 bit > value\n", val64); > + rc = ERROR_FAIL; > + > +out: > + GC_FREE; > + return rc; > +} > + ...does more 64to32 then 32to64, but maybe that's me, and, anyway, it's certainly not a big deal. Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |