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

Re: [Xen-devel] [PATCH] xl: ensure handle_domain & preserve_domain update the global domid not a shadow



On Mon, Jul 2, 2012 at 11:15 AM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@xxxxxxxxxx>
> # Date 1341224092 -3600
> # Node ID e3f4595bdbd87ac71151f01ed2be36e45636458b
> # Parent  b625271894d40aecd9599bf448129e14d0af0122
> xl: ensure handle_domain & preserve_domain update the global domid not a 
> shadow
>
> xl keeps the current domid in a global variable, however it also has various
> functions (including the two above) which take a domid parameter which shadows
> this.
>
> This fixes the issue introduced by 25563:dbf54d93ac40 "xl: initialise domid to
> an explicitly invalid value" but does not tackle the wider problem.
>
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Acked-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>

(just a minor typo)

> ---
>
> I looked at fixing this by both removing the global domid or renaming the
> shadowing arguments but both were pretty invasive and I wanted to get this
> test failure fixed. Compiling tools/libxl with Wshadow shows that this is far
> from the only instance of this kind of problem. We should look to enable this
> warning in 4.3.

Yes, fixing this is 4.3 material I think.

> diff -r b625271894d4 -r e3f4595bdbd8 tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c  Mon Jul 02 10:39:23 2012 +0100
> +++ b/tools/libxl/xl_cmdimpl.c  Mon Jul 02 11:14:52 2012 +0100
> @@ -1328,8 +1328,9 @@ static void reload_domain_config(uint32_
>  }
>
>  /* Returns 1 if domain should be restarted,
> - * 2 if domain should be renamed then restarted, or 0 */
> -static int handle_domain_death(uint32_t domid,
> + * 2 if domain should be renamed then restarted, or 0
> + * Can update r_domid if doain is destroyed etc */

domain

> +static int handle_domain_death(uint32_t *r_domid,
>                                 libxl_event *event,
>                                 uint8_t **config_data, int *config_len,
>                                 libxl_domain_config *d_config)

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


 


Rackspace

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