All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Marek Marczykowski <marmarek@invisiblethingslab.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxl: do not call default block script
Date: Fri, 10 May 2013 16:19:15 +0200	[thread overview]
Message-ID: <518D01E3.2080104@citrix.com> (raw)
In-Reply-To: <20130508050803.24369304@duch.mimuw.edu.pl>

On 08/05/13 07:07, Marek Marczykowski wrote:
> When user didn't specified disk->script, libxl writes physical-device
> node itself, making script call redundant - especially the default one.

This change will break NetBSD support, please also attach the necessary
NetBSD change or at least mention it in the commit message, so it can be
fixed.

If I'm right, the block script does other things apart from writing the
physical device major/minor, it also checks that no other domain is
using this device. If you want to make the hotplug script call non
redundant I would recommend to prevent libxl from witting physical
device major/minor instead of removing the execution of the hotplug script.

> Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
> ---
>  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

libxl_netbsd.c should also be modified to reflect this change.

> @@ -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);
> 

  parent reply	other threads:[~2013-05-10 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  5:07 [PATCH] libxl: do not call default block script Marek Marczykowski
2013-05-10 13:58 ` Ian Campbell
2013-05-10 14:19 ` Roger Pau Monné [this message]
2013-05-10 14:21   ` Ian Campbell
2013-05-10 14:29     ` Roger Pau Monné
2013-05-10 14:41       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518D01E3.2080104@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.