libxl: fix usage of backend parameter and run_hotplug_scripts
PATCH v2 1/2 libxl: fix usage of backend parameter and run_hotplug_scripts
vif interfaces allows the user to specify the domain that should run the backend (also known as driver domain) using the 'backend' parameter. This is not compatible with run_hotplug_scripts=1, since libxl can only run the hotplug scripts from the Domain 0.
---
Changes since v1:
* Remove references to xl.conf, since it's a layering violation.
* Move the docs update to next patch (that includes xl changes).
--- tools/libxl/libxl.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
tools/libxl/libxl.c +14 -0
@@ -2474,6 +2474,8 @@ out:int libxl__device_nic_setdefault (libxl__gc *gc,libxl_device_nic *nic,uint32_t domid) { +int run_hotplug_scripts; +if (!nic->mtu) nic->mtu =1492 ;if (!nic->model) {
@@ -2503,6 +2505,18 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic, libxl__xen_script_dir_path()) < 0 )return ERROR_FAIL ; + run_hotplug_scripts =libxl__hotplug_settings (gc,XBT_NULL ); +if (run_hotplug_scripts <0 ) { +LOG (ERROR ,"unable to get current hotplug scripts execution setting" ); +return run_hotplug_scripts; + } +if (nic->backend_domid !=LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) { +LOG (ERROR ,"cannot use a backend domain different than %d if" +"hotplug scripts are executed from libxl" , +LIBXL_TOOLSTACK_DOMID ); +return ERROR_FAIL ; + } +switch (libxl__domain_type (gc, domid)) {case LIBXL_DOMAIN_TYPE_HVM :if (!nic->nictype)
Signature · 1 line
1.7.7.5 (Apple Git-26)
PATCH v2 2/2 xl: error if vif backend!=0 is used with run_hotplug_scripts
Print an error and exit if backend!=0 is used in conjunction with run_hotplug_scripts. Currently libxl can only execute hotplug scripts from the toolstack domain (the same domain xl is running from).
Added a description and workaround of this issue on xl-network-configuration.
--- docs/misc/xl-network-configuration.markdown | 6 ++++-- tools/libxl/xl_cmdimpl.c | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
docs/misc/xl-network-configuration.markdown +4 -2
@@ -122,8 +122,10 @@ specified IP address to be used by the guest (blocking all others). ### backend Specifies the backend domain which this device should attach to. This -defaults to domain 0. Specifying another domain requires setting up a -driver domain which is outside the scope of this document. +defaults to domain 0. This option does not work if `run_hotplug_scripts` +is not disabled in xl.conf (see xl.conf(5) man page for more information +on this option). Specifying another domain requires setting up a driver +domain which is outside the scope of this document. ### rate
tools/libxl/xl_cmdimpl.c +7 -0
@@ -1000,6 +1000,13 @@ static void parse_config_data(const char *config_source,fprintf (stderr,"Specified backend domain does not exist, defaulting to Dom0\n" ); nic->backend_domid =0 ; } +if (nic->backend_domid !=0 && run_hotplug_scripts) { +fprintf (stderr,"ERROR: the vif 'backend=' option " +"cannot be used in conjunction with " +"run_hotplug_scripts, please set " +"run_hotplug_scripts to 0 in xl.conf\n" ); +exit (EXIT_FAILURE ); + } }else if (!strcmp (p,"rate" )) {parse_vif_rate (&config, (p2 +1 ), nic); }else if (!strcmp (p,"accel" )) {
Signature · 1 line
1.7.7.5 (Apple Git-26)
Re: [PATCH v2 2/2] xl: error if vif backend!=0 is used with run_hotplug_scripts
Quoted 8 lines · Roger Pau Monne
Print an error and exit if backend!=0 is used in conjunction with
run_hotplug_scripts. Currently libxl can only execute hotplug scripts from the toolstack domain (the same domain xl is running from).Added a description and workaround of this issue on xl-network-configuration.
Signed-off-by Roger Pau Monne <[email protected]>
Acked + applied, thanks.
Quoted 4 lines · Roger Pau Monne
vif interfaces allows the user to specify the domain that should run the backend (also known as driver domain) using the 'backend' parameter. This is not compatible with run_hotplug_scripts=1, since libxl can only run the hotplug scripts from the Domain 0.
Sorry but I think in the end this has missed the cut-off for 4.2.0 (we are cutting the final RC tomorrow).
We should be branching soon after the final RC which means 4.3 development will open in unstable shortly. We should take this into unstable then and consider it for 4.2.1.
In the meantime I suppose we should mention this in the release notes.
Quoted 6 lines · Ian Campbell
Quoted 4 lines · Roger Pau Monne
vif interfaces allows the user to specify the domain that should run the backend (also known as driver domain) using the 'backend' parameter. This is not compatible with run_hotplug_scripts=1, since libxl can only run the hotplug scripts from the Domain 0.
Quoted 8 lines
Sorry but I think in the end this has missed the cut-off for 4.2.0 (we are cutting the final RC tomorrow).
We should be branching soon after the final RC which means 4.3 development will open in unstable shortly. We should take this into unstable then and consider it for 4.2.1.
In the meantime I suppose we should mention this in the release notes.
Do you think we could commit the docs change (xl-network-configuration.markdown) only? So people can know that this won't work in current release.
Sorry for the delay.
Quoted 14 lines · Roger Pau Monne
Quoted 13 lines · Ian Campbell
Quoted 4 lines · Roger Pau Monne
vif interfaces allows the user to specify the domain that should run the backend (also known as driver domain) using the 'backend' parameter. This is not compatible with run_hotplug_scripts=1, since libxl can only run the hotplug scripts from the Domain 0.
Sorry but I think in the end this has missed the cut-off for 4.2.0 (we are cutting the final RC tomorrow).
We should be branching soon after the final RC which means 4.3 development will open in unstable shortly. We should take this into unstable then and consider it for 4.2.1.
Quoted 5 lines
Quoted 1 line
In the meantime I suppose we should mention this in the release notes.
Do you think we could commit the docs change (xl-network-configuration.markdown) only? So people can know that this won't work in current release.
I think we can take some docs only patches after RC4, I don't want to taker any patches before then since we need a test pass before we tag it tomorrow.
Quoted 1 line
Sorry for the delay.
S'OK.
Ian.
Quoted 6 lines · Roger Pau Monne
vif interfaces allows the user to specify the domain that should run the backend (also known as driver domain) using the 'backend' parameter. This is not compatible with run_hotplug_scripts=1, since libxl can only run the hotplug scripts from the Domain 0.
Signed-off-by Roger Pau Monne <[email protected]>
Acked + applied, thanks.
Quoted 42 lines
---
Changes since v1:* Remove references to xl.conf, since it's a layering violation.
* Move the docs update to next patch (that includes xl changes).
--- tools/libxl/libxl.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)tools/libxl/libxl.c +14
-0@@ -2474,6 +2474,8 @@ out:int libxl__device_nic_setdefault (libxl__gc *gc,libxl_device_nic *nic,uint32_t domid) { +int run_hotplug_scripts; +if (!nic->mtu) nic->mtu =1492 ;if (!nic->model) {@@ -2503,6 +2505,18 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic, libxl__xen_script_dir_path()) < 0 )return ERROR_FAIL ; + run_hotplug_scripts =libxl__hotplug_settings (gc,XBT_NULL ); +if (run_hotplug_scripts <0 ) { +LOG (ERROR ,"unable to get current hotplug scripts execution setting" ); +return run_hotplug_scripts; + } +if (nic->backend_domid !=LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) { +LOG (ERROR ,"cannot use a backend domain different than %d if" +"hotplug scripts are executed from libxl" , +LIBXL_TOOLSTACK_DOMID ); +return ERROR_FAIL ; + } +switch (libxl__domain_type (gc, domid)) {case LIBXL_DOMAIN_TYPE_HVM :if (!nic->nictype)