From: Ian Campbell Subject: Re: [PATCH] libxl: do not call default block script Date: Fri, 10 May 2013 14:58:50 +0100 Message-ID: <1368194330.27857.126.camel@zakaz.uk.xensource.com> References: <20130508050803.24369304@duch.mimuw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130508050803.24369304@duch.mimuw.edu.pl> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Marek Marczykowski Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-05-08 at 06:07 +0100, Marek Marczykowski wrote: > When user didn't specified disk->script, libxl writes physical-device > node itself, making script call redundant - especially the default one. Redundant, but not harmful in any way, right? IOW this is 4.4 material? > > Signed-off-by: Marek Marczykowski > --- > tools/libxl/libxl.c | 8 +++++--- > tools/libxl/libxl_linux.c | 5 ++--- > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index 6733e71..58b7a03 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -2093,9 +2093,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid, > flexarray_append(back, "params"); > flexarray_append(back, dev); > > - script = libxl__abs_path(gc, disk->script?: "block", > - libxl__xen_script_dir_path()); > - flexarray_append_pair(back, "script", script); > + if (disk->script) { > + script = libxl__abs_path(gc, disk->script, > + libxl__xen_script_dir_path()); > + flexarray_append_pair(back, "script", script); > + } > > /* If the user did not supply a block script then we > * write the physical-device node ourselves. > diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c > index 115332a..923a1d0 100644 > --- a/tools/libxl/libxl_linux.c > +++ b/tools/libxl/libxl_linux.c > @@ -334,9 +334,8 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__device *dev, > script = libxl__xs_read(gc, XBT_NULL, > GCSPRINTF("%s/%s", be_path, "script")); > if (!script) { > - LOGEV(ERROR, errno, "unable to read script from %s", be_path); > - rc = ERROR_FAIL; > - goto error; > + LOG(INFO, "no script for %s", be_path); > + return 0; > } > > *env = get_hotplug_env(gc, script, dev);