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

Re: [Xen-devel] [PATCH v1 2/3] livepatch: Include sizes when an mismatch occurs



>>> Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> 07/11/17 6:53 PM >>>
>--- a/xen/common/livepatch.c
>+++ b/xen/common/livepatch.c
>@@ -520,8 +520,8 @@ static int prepare_payload(struct payload *payload,
     >ASSERT(sec);
     >if ( sec->sec->sh_size % sizeof(*payload->funcs) )
     >{
>-        dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of 
>"ELF_LIVEPATCH_FUNC"!\n",
>-                elf->name);
>+        dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of 
>"ELF_LIVEPATCH_FUNC"! (exp: %zu vs %"PRIuElfWord")\n",
>+                elf->name, sizeof(*payload->funcs), sec->sec->sh_size);

What you print as expected value isn't really the only permitted one - the
expectation is the value to be a multiple of it. I wonder if the message
text therefore isn't confusing now. Also, how about embedding the actual
size right in the base message, i.e. something like ''Wrong size NNN of ...
(must be multiple of MMM)"?

Jan


_______________________________________________
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®.