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

Re: [Xen-devel] [livepatch-build-tools part3 1/3] create-diff-object: Do not create empty .livepatch.funcs section



On Tue, Apr 16, 2019 at 12:22:39PM +0000, Pawel Wieczorkiewicz wrote:
> When there is no changed function in the generated payload, do not
> create an empty .livepatch.funcs section. Hypervisor code considers
> such payloads as broken and rejects to load them.
> 
> Such payloads without any changed functions may appear when only
> hooks are specified.

Ross, I am going to push this in next week unless you have other thoughts?

> 
> Signed-off-by: Pawel Wieczorkiewicz <wipawel@xxxxxxxxx>
> Reviewed-by: Martin Mazein <amazein@xxxxxxxxx>
> Reviewed-by: Martin Pohlack <mpohlack@xxxxxxxxx>
> 
> CR: https://code.amazon.com/reviews/CR-7368634
> ---
>  create-diff-object.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/create-diff-object.c b/create-diff-object.c
> index 82f777e..af2245c 100644
> --- a/create-diff-object.c
> +++ b/create-diff-object.c
> @@ -1744,6 +1744,11 @@ static void livepatch_create_patches_sections(struct 
> kpatch_elf *kelf,
>               if (sym->type == STT_FUNC && sym->status == CHANGED)
>                       nr++;
>  
> +     if (nr == 0) {
> +             log_debug("No changed functions found. Skipping 
> .livepatch.funcs section creation\n");
> +             return;
> +     }
> +
>       /* create text/rela section pair */
>       sec = create_section_pair(kelf, ".livepatch.funcs", sizeof(*funcs), nr);
>       relasec = sec->rela;
> -- 
> 2.16.5
> 
> 
> 
> 
> Amazon Development Center Germany GmbH
> Krausenstr. 38
> 10117 Berlin
> Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
> Ust-ID: DE 289 237 879
> Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
> 
> 

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