All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH] libxl: fix printing hotplug arguments/environment
Date: Tue, 2 Aug 2016 10:13:42 +0100	[thread overview]
Message-ID: <20160802091342.GR22419@citrix.com> (raw)
In-Reply-To: <1470068456-15064-1-git-send-email-roger.pau@citrix.com>

On Mon, Aug 01, 2016 at 06:20:56PM +0200, Roger Pau Monne wrote:
> A OS could decide to not pass arguments or any environment variables to

"An"

> hotplug scripts, and this will trigger a bug in device_hotplug logic, since
> it expects both the argument and the environment arrays to exist. Allow
> both args or env to be NULL.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
>  tools/libxl/libxl_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index b9a6df2..0e5f546 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -1132,7 +1132,7 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
>  
>      LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]);
>      LOG(DEBUG, "extra args:");
> -    {
> +    if ( args != NULL) {

Minor nit, extraneous space here.

Shouldn't this check be moved before the "calling hotplug script..."
line?

>          const char *arg;
>          unsigned int x;
>  
> @@ -1140,7 +1140,7 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
>              LOG(DEBUG, "\t%s", arg);
>      }
>      LOG(DEBUG, "env:");
> -    {
> +    if ( env != NULL) {
>          const char *k, *v;
>          unsigned int x;
>  
> -- 
> 2.7.4 (Apple Git-66)
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-02  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 16:20 [PATCH] libxl: fix printing hotplug arguments/environment Roger Pau Monne
2016-08-02  9:13 ` Wei Liu [this message]
2016-08-02  9:27   ` Roger Pau Monne
2016-08-02  9:31     ` Wei Liu
2016-08-02 16:03 ` Wei Liu

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=20160802091342.GR22419@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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.