[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Xen 4.6 script calling conventions



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@xxxxxxxxxx>
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@xxxxxxxxx>
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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) ||
+            (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


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.