From: Ian Jackson Subject: Re: [PATCH 10/13] libxl: add option to choose who executes hotplug scripts Date: Fri, 18 May 2012 17:40:41 +0100 Message-ID: <20406.31625.419471.868948@mariner.uk.xensource.com> References: <1337184716-49276-1-git-send-email-roger.pau@citrix.com> <1337184716-49276-11-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: <1337184716-49276-11-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: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH 10/13] libxl: add option to choose who executes hotplug scripts"): > Add and option to xl.conf file to decide if hotplug scripts are > executed from the toolstack (xl) or from udev as it used to be in the > past. ... > + if (libxl_defbool_val(info->run_hotplug_scripts)) { > + if (!libxl__xs_read(gc, t, DISABLE_UDEV_PATH) && (nb_vm - 1)) { > + LOG(ERROR, "cannot change hotplug execution option once set, " > + "please shutdown all guests before changing it"); > + rc = ERROR_FAIL; > + goto out; > + } > + libxl__xs_write(gc, t, DISABLE_UDEV_PATH, "1"); > + } else { > + if (libxl__xs_read(gc, t, DISABLE_UDEV_PATH) && (nb_vm - 1)) { > + LOG(ERROR, "cannot change hotplug execution option once set, " > + "please shutdown all guests before changing it"); > + rc = ERROR_FAIL; > + goto out; > + } > + xs_rm(ctx->xsh, t, DISABLE_UDEV_PATH); How about int disable_wanted_now = something involving libxl__xs_read(....); if (disable_wanted_now != libxl_defbool_val(info->run_hotplug_scripts) { LOG(ERROR, etc. } ? Also you should check for the errno value from libxl__xs_read. ENOENT is fine but anything else should be a fatal error. Ian.