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

Re: [Xen-devel] [livepatch: independ. modules 3/3] python: Add XC binding for Xen build ID



> On 19. Aug 2019, at 22:40, Marek Marczykowski-Górecki 
> <marmarek@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> On Thu, Aug 15, 2019 at 09:44:00AM +0000, Pawel Wieczorkiewicz wrote:
>> Extend the list of xc() object methods with additional one to display
>> Xen's buildid. The implementation follows the libxl implementation
>> (e.g. max buildid size assumption being XC_PAGE_SIZE).
>> 
>> Signed-off-by: Pawel Wieczorkiewicz <wipawel@xxxxxxxxx>
>> Reviewed-by: Martin Mazein <amazein@xxxxxxxxx>
>> Reviewed-by: Andra-Irina Paraschiv <andraprs@xxxxxxxxxx>
>> Reviewed-by: Norbert Manthey <nmanthey@xxxxxxxxx>
>> ---
>> v2:
>> 
…snip...
>> 
>> +static PyObject *pyxc_xenbuildid(XcObject *self)
>> +{
>> +    xen_build_id_t *buildid;
>> +    int i, r;
>> +    char *str;
>> +
>> +    buildid = alloca(sizeof(buildid->len) + XC_PAGE_SIZE);
>> +    buildid->len = XC_PAGE_SIZE - sizeof(*buildid);
> 
> Those doesn't match. You allocated XC_PAGE_SIZE in addition to
> sizeof(buildid->len). I'd change to alloca(XC_PAGE_SIZE) - it is
> unlikely that izeof(buildid->len) would be larger than XC_PAGE_SIZE and
> we do assume it in other places anyway.

ACK. Will fix.

> 
>> +
>> +    r = xc_version(self->xc_handle, XENVER_build_id, buildid);
>> +    if ( r <= 0 )
>> +        return pyxc_error_to_exception(self->xc_handle);
>> +
>> 

…snip...

> 
> -- 
> Best Regards,
> Marek Marczykowski-Górecki
> Invisible Things Lab
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?


Best Regards,
Pawel Wieczorkiewicz






Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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