[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl/netbsd: check num_exec in hotplug function
On Jul 4, 12:23pm, Wei Liu wrote: } } 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. Oops, I usually do (*checks header*; yep, good this time). } > 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@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) || } > > } > > 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. Yes, when the script is called the second time, it fails when trying to add the interface to the bridge and returns an error. This results in xl aborting the domU creation process and tearing it down. If the script is supposed to be called twice, then there needs to be some way to distinguish the calls and what is supposed to happen during each call so the script can be adjusted. The change above allowed me to bring up a domU and work with it (including network). However, I only tested a PV domU, not an HVM one, so QEMU wasn't involved. } > > } + (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 }-- End of excerpt from Wei Liu _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |