From: Ian Campbell Subject: Re: [PATCH v6 08/13] libxl: add option to choose who executes hotplug scripts Date: Tue, 3 Jul 2012 09:33:34 +0100 Message-ID: <1341304414.4625.155.camel@zakaz.uk.xensource.com> References: <1339676475-33265-1-git-send-email-roger.pau@citrix.com> <1339676475-33265-9-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1339676475-33265-9-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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)))