All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: John Nemeth <jnemeth@cue.bc.ca>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH] libxl/netbsd: check num_exec in hotplug function
Date: Mon, 4 Jul 2016 12:23:39 +0100	[thread overview]
Message-ID: <20160704112339.GC16787@citrix.com> (raw)
In-Reply-To: <20160704110930.GA16787@citrix.com>

Also CC Roger since he authored the original code.

Feel free to correct me misunderstanding on this issue.

On Mon, Jul 04, 2016 at 12:09:30PM +0100, Wei Liu wrote:
> Add back xen-devel. Please reply to all recipients in the future.
> 
> On Mon, Jul 04, 2016 at 01:11:04AM -0700, John Nemeth wrote:
> > On Jul 2, 12:35pm, Wei Liu wrote:
> > }
> > } This basically replicates the same logic in libxl_linux.c. Without this
> > } libxl will loop indefinitely trying to execute hotplug script.
> > 
> >      One minor change required (see below).
> > 
> > } 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) ||
> > 
> >      The function is called with num_exec set to 0 and 1, so this
> > should be:
> > 
> >            if ((num_exec != 0) ||
> > 
> 
> AIUI this is related to how network is setup because we would need to
> hotplug both the emulated nic in QEMU and the PV nic. Is this line
> causing problem for you?
> 
> Wei.
> 
> > } +            (libxl_get_stubdom_id(CTX, dev->domid) && num_exec)) {
> > } +            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;
> > } -- 
> > } 2.1.4
> > } 
> > }-- End of excerpt from Wei Liu

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

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201607040811.u648B4MN011551@server.cornerstoneservice.ca>
2016-07-04 11:09 ` [PATCH] libxl/netbsd: check num_exec in hotplug function Wei Liu
2016-07-04 11:23   ` Wei Liu [this message]
2016-07-04 11:56     ` John Nemeth
2016-07-04 12:02       ` Roger Pau Monné
2016-07-04 12:13 Wei Liu
2016-07-06 17:27 ` 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=20160704112339.GC16787@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.