All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: John Nemeth <jnemeth@cue.bc.ca>, Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: Xen 4.6 script calling conventions
Date: Mon, 4 Jul 2016 13:04:01 +0100	[thread overview]
Message-ID: <20160704120401.GA17629@citrix.com> (raw)
In-Reply-To: <20160704115720.vz3h3a2f25uzkd22@mac>

On Mon, Jul 04, 2016 at 01:57:20PM +0200, Roger Pau Monné wrote:
> On Sat, Jul 02, 2016 at 12:40:43PM +0100, Wei Liu wrote:
> > On Tue, Jun 28, 2016 at 06:00:49PM -0700, John Nemeth wrote:
> > >      I'm trying to package Xen 4.6 (specifically Xen 4.6.3) for
> > > use with NetBSD.  I have it mostly done; however, when I try to
> > > create a domU, libxl goes into an infinite loop calling the scripts.
> > > If I try to create a domU with no network or disk, it works fine
> > > (albeit of rather limited use).  Have there been changes between
> > > Xen 4.5 and Xen 4.6 in the calling convention for the scripts?  Is
> > > there documentation on what is expected somewhere?  Please CC me on
> > > any responses.  Here is my domU config file:
> > 
> > Can you give this patch a try? I don't have netbsd system at hand to
> > test it.
> > 
> > I suspect netbsd doesn't support stubdom because that pile of code is a
> > bit Linux centric, but it wouldn't hurt to prepare for it.
> > 
> > ---8<---
> > From 3c64a22f4a5dcf76244c2acff7a26717402ea33c Mon Sep 17 00:00:00 2001
> > From: Wei Liu <wei.liu2@citrix.com>
> > Date: Sat, 2 Jul 2016 12:35:30 +0100
> > Subject: [PATCH] libxl/netbsd: check num_exec in hotplug function
> > 
> > This basically replicates the same logic in libxl_linux.c. Without this
> > libxl will loop indefinitely trying to execute hotplug script.
> > 
> > Reported-by: John Nemeth <jnemeth@cue.bc.ca>
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> >  tools/libxl/libxl_netbsd.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/tools/libxl/libxl_netbsd.c b/tools/libxl/libxl_netbsd.c
> > index 096c057..92d3c89 100644
> > --- a/tools/libxl/libxl_netbsd.c
> > +++ b/tools/libxl/libxl_netbsd.c
> > @@ -68,7 +68,25 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev,
> >  
> >      switch (dev->backend_kind) {
> >      case LIBXL__DEVICE_KIND_VBD:
> > +        if (num_exec != 0) {
> > +            LOG(DEBUG, "num_exec %d, not running hotplug scripts", num_exec);
> > +            rc = 0;
> > +            goto out;
> > +        }
> > +        rc = libxl__hotplug(gc, dev, args, action);
> > +        if (!rc) rc = 1;
> > +        break;
> >      case LIBXL__DEVICE_KIND_VIF:
> > +        /*
> > +         * If domain has a stubdom we don't have to execute hotplug scripts
> > +         * for emulated interfaces
> > +         */
> > +        if ((num_exec > 1) ||
> 
> This should be num_exec != 0, NetBSD libxl only executes the network hotplug 
> script once, because the emulated network card is attached to the bridge 
> using a script called directly by QEMU, see:
> 
> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl_dm.c;hb=HEAD#l608
> 
> And:
> 
> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl_dm.c;hb=HEAD#l27 
> 
> Apart from that the change looks fine, and provided this is fixed:
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> 

Thanks for your clarification on how netbsd works.

I will update the patch accordingly.

Wei.

> Thanks, Roger.

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

      reply	other threads:[~2016-07-04 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29  1:00 Xen 4.6 script calling conventions John Nemeth
2016-06-29 15:46 ` Dario Faggioli
2016-07-02 11:40 ` Wei Liu
2016-07-04  8:07   ` John Nemeth
2016-07-04 11:18     ` Wei Liu
2016-07-04 11:45     ` Roger Pau Monné
2016-07-04 11:57   ` Roger Pau Monné
2016-07-04 12:04     ` Wei Liu [this message]

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=20160704120401.GA17629@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=jnemeth@cue.bc.ca \
    --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.