All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 25557458 authored by Ian Jackson's avatar Ian Jackson

libxl: provide full path to vif hotplug script script

This improves compatibility with xm style config files since xend does
this (see NetifController.getDeviceDetails() in
tools/python/xen/xend/server/ and
tools/hotplug/Linux/vif-setup expects an absolute path to the script.

This patch supports both absolute and relative paths in the
configuration.  Also, if somehow nic->script==NULL, don't add write
the entry to xenstore at all (rather than crashing due to the new
check for absolute vs relative path).
Signed-off-by: default avatarIan Campbell <>
Signed-off-by: default avatarIan Jackson <>
Committed-by: default avatarIan Jackson <>
parent 7554f92a
......@@ -1234,8 +1234,13 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
flexarray_append(back, "1");
flexarray_append(back, "state");
flexarray_append(back, libxl__sprintf(&gc, "%d", 1));
flexarray_append(back, "script");
flexarray_append(back, nic->script);
if (nic->script) {
flexarray_append(back, "script");
flexarray_append(back, nic->script[0]=='/' ? nic->script
: libxl__sprintf(&gc, "%s/%s",
flexarray_append(back, "mac");
flexarray_append(back, libxl__sprintf(&gc, "%02x:%02x:%02x:%02x:%02x:%02x",
nic->mac[0], nic->mac[1], nic->mac[2],
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment