Default bridge for xl
If I did not miss something, it looks to me like guests started with xl will use the bridge specified in the guest config or xenbr0 as a default. Just wondering whether adding a defaultbridge config option to xl.conf would be considered a waste of time (because its not desired to have that) or some worth of adding when I would come up with a patch?
Cheers,
-Stefan
Quoted 5 lines · Stefan Bader
If I did not miss something, it looks to me like guests started with xl will use the bridge specified in the guest config or xenbr0 as a default. Just wondering whether adding a defaultbridge config option to xl.conf would be considered a waste of time (because its not desired to have that) or some worth of adding when I would come up with a patch?
Sounds useful enough to me.
Ian.
Quoted 9 lines · Ian Campbell
Quoted 5 lines · Stefan Bader
If I did not miss something, it looks to me like guests started with xl will use the bridge specified in the guest config or xenbr0 as a default. Just wondering whether adding a defaultbridge config option to xl.conf would be considered a waste of time (because its not desired to have that) or some worth of adding when I would come up with a patch?
Sounds useful enough to me.
Quoted 8 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
So maybe the following is good. Hopefully not introduced any stupid typos while moving it from the version where it was tested to HEAD.
-Stefan
Quoted 1 line
From
d58ebda4fbe831b491d43a6988f3006b8f1a9825Mon Sep 17 00:00:00 2001
From: Stefan Bader <[email protected]>
Date: Fri, 10 Feb 2012 18:03:26 +0100
Subject: [PATCH] Add defaultbridge config option for xl.conf
Currently guests created with the xl stack will have "xenbr0" written as their default into xenstore. It can be changed in the individual guest config files, but there is no way to have that default globally changed.
Add a config option to xl.conf that allows to have a different default bridge name.
--- docs/man/xl.conf.pod.5 | 6 ++++++ tools/libxl/xl.c | 4 ++++ tools/libxl/xl.h | 1 + tools/libxl/xl_cmdimpl.c | 5 +++++ 4 files changed, 16 insertions(+), 0 deletions(-)
docs/man/xl.conf.pod.5 +0 -0
@@ -68,6 +68,12 @@ Configures the default hotplug script used by virtual network
devices.
Default: C</etc/xen/scripts/vif-bridge>
+=item B<defaultbridge="NAME">
+
+Configures the default bridge to set for virtual network devices. +
+Default: C<xenbr0>
+
=item B<output_format="json|sxp">
Configures the default output format used by xl when printing "machine
tools/libxl/xl.c +4 -0
@@ -38,6 +38,7 @@ int dryrun_only;int autoballoon =1 ;char *lockfile;char *default_vifscript =NULL ; +char *default_bridge =NULL ;enum output_format default_output_format =OUTPUT_FORMAT_JSON ;static xentoollog_level minmsglevel =XTL_PROGRESS ;
@@ -79,6 +80,9 @@ static void parse_global_config(const char *configfile,if (!xlu_cfg_get_string (config,"vifscript" , &buf,0 )) default_vifscript =strdup (buf); +if (!xlu_cfg_get_string (config,"defaultbridge" , &buf,0 )) + default_bridge =strdup (buf); +if (!xlu_cfg_get_string (config,"output_format" , &buf,0 )) {if (!strcmp (buf,"json" )) default_output_format =OUTPUT_FORMAT_JSON ;
tools/libxl/xl.h +1 -0
@@ -110,6 +110,7 @@ extern int autoballoon;extern int dryrun_only;extern char *lockfile;extern char *default_vifscript; +extern char *default_bridge;enum output_format {OUTPUT_FORMAT_JSON ,
tools/libxl/xl_cmdimpl.c +0 -0
@@ -842,6 +842,11 @@ static void parse_config_data(const char
*configfile_filename_report,
nic->script = strdup(default_vifscript);
}+ if (default_bridge) {
+ free(nic->bridge);
+ nic->bridge = strdup(default_bridge);
+ }
+
p = strtok(buf2, ",");
if (!p)
goto skip;Signature · 1 line
1.7.5.4
Quoted 1 line
From
d58ebda4fbe831b491d43a6988f3006b8f1a9825Mon Sep 17 00:00:00 2001
From: Stefan Bader <[email protected]>
Date: Fri, 10 Feb 2012 18:03:26 +0100
Subject: [PATCH] Add defaultbridge config option for xl.conf
Currently guests created with the xl stack will have "xenbr0" written as their default into xenstore. It can be changed in the individual guest config files, but there is no way to have that default globally changed.
Add a config option to xl.conf that allows to have a different default bridge name.
--- docs/man/xl.conf.pod.5 | 6 ++++++ tools/libxl/xl.c | 4 ++++ tools/libxl/xl.h | 1 + tools/libxl/xl_cmdimpl.c | 5 +++++ 4 files changed, 16 insertions(+), 0 deletions(-)
docs/man/xl.conf.pod.5 +6 -0
@@ -68,6 +68,12 @@ Configures the default hotplug script used by virtual network devices. Default: C</etc/xen/scripts/vif-bridge> +=item B<defaultbridge="NAME"> + +Configures the default bridge to set for virtual network devices. + +Default: C<xenbr0> + =item B<output_format="json|sxp"> Configures the default output format used by xl when printing "machine
tools/libxl/xl.c +4 -0
@@ -38,6 +38,7 @@ int dryrun_only;int autoballoon =1 ;char *lockfile;char *default_vifscript =NULL ; +char *default_bridge =NULL ;enum output_format default_output_format =OUTPUT_FORMAT_JSON ;static xentoollog_level minmsglevel =XTL_PROGRESS ;
@@ -79,6 +80,9 @@ static void parse_global_config(const char *configfile,if (!xlu_cfg_get_string (config,"vifscript" , &buf,0 )) default_vifscript =strdup (buf); +if (!xlu_cfg_get_string (config,"defaultbridge" , &buf,0 )) + default_bridge =strdup (buf); +if (!xlu_cfg_get_string (config,"output_format" , &buf,0 )) {if (!strcmp (buf,"json" )) default_output_format =OUTPUT_FORMAT_JSON ;
tools/libxl/xl.h +1 -0
@@ -110,6 +110,7 @@ extern int autoballoon;extern int dryrun_only;extern char *lockfile;extern char *default_vifscript; +extern char *default_bridge;enum output_format {OUTPUT_FORMAT_JSON ,
tools/libxl/xl_cmdimpl.c +5 -0
@@ -842,6 +842,11 @@ static void parse_config_data(const char *configfile_filename_report, nic->script =strdup (default_vifscript); } +if (default_bridge) { +free (nic->bridge); + nic->bridge =strdup (default_bridge); + } + p =strtok (buf2,"," );if (!p) goto skip;
Signature · 1 line
1.7.5.4
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ian Jackson
Acked-byStefan Bader writes ("Re: [Xen-devel] Default bridge for xl"):
Quoted 2 lines
So maybe the following is good. Hopefully not introduced any stupid typos while moving it from the version where it was tested to HEAD.
Looks good to me.
Quoted 1 line
Subject: [PATCH] Add defaultbridge config option for xl.conf
Thanks,
Ian.