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

Re: [Xen-devel] [PATCH v6 08/13] libxl: add option to choose who executes hotplug scripts



On Thu, 2012-06-14 at 13:21 +0100, Roger Pau Monne wrote:
> @@ -70,6 +71,9 @@ static void parse_global_config(const char *configfile,
>      if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
>          autoballoon = l;
>  
> +    libxl_defbool_setdefault(&run_hotplug_scripts, true);
> +    xlu_cfg_get_defbool(config, "run_hotplug_scripts", &run_hotplug_scripts, 
> 0);


>      if (!xlu_cfg_get_string (config, "lockfile", &buf, 0))
>          lockfile = strdup(buf);
>      else {
> diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
> index 59556b5..fddaecb 100644
> --- a/tools/libxl/xl.h
> +++ b/tools/libxl/xl.h
> @@ -140,6 +140,7 @@ int xl_child_pid(xlchildnum); /* returns 0 if child 
> struct is not in use */
>  
>  /* global options */
>  extern int autoballoon;
> +extern libxl_defbool run_hotplug_scripts;
>  extern int dryrun_only;
>  extern char *lockfile;
>  extern char *default_vifscript;
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 404c9c2..fd980b1 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -594,6 +594,7 @@ static void parse_config_data(const char *config_source,
>          }
>      }
>  
> +    c_info->run_hotplug_scripts = run_hotplug_scripts;

This should be libxl_defbool_set(&c_info->...., run_hotplug_scripts)
where the run_hotplug_script can be a plain boolean and doesn't need to
be a defbool. Since the variable is contained within xl we don't need a
separate specific "default" value.

You also need a call to libxl_defbool_setdefault in
libxl__domain_create_info_setdefault to handle toolstacks which do not
have an opinion. This is the cause of the stubdom failure I reported
before.

You might also want to propagate the value from the main domain to the
stubdom PV domain, Actually I assume you'll need this because the user
needs to be able to configure both with the same key.

>      c_info->type = LIBXL_DOMAIN_TYPE_PV;
>      if (!xlu_cfg_get_string (config, "builder", &buf, 0) &&
>          !strncmp(buf, "hvm", strlen(buf)))



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