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

[Xen-changelog] [xen-unstable] xl: Add defaultbridge config option for xl.conf



# HG changeset patch
# User Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
# Date 1329155113 0
# Node ID 60526e46625c20e5475fbf4f403dd164bb699037
# Parent  e03d1005e484e8ad055687952b1e30d56632e8c2
xl: 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.

Signed-off-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r e03d1005e484 -r 60526e46625c docs/man/xl.conf.pod.5
--- a/docs/man/xl.conf.pod.5    Mon Feb 13 17:32:21 2012 +0000
+++ b/docs/man/xl.conf.pod.5    Mon Feb 13 17:45:13 2012 +0000
@@ -68,6 +68,12 @@
 
 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
diff -r e03d1005e484 -r 60526e46625c tools/libxl/xl.c
--- a/tools/libxl/xl.c  Mon Feb 13 17:32:21 2012 +0000
+++ b/tools/libxl/xl.c  Mon Feb 13 17:45:13 2012 +0000
@@ -38,6 +38,7 @@
 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 @@
     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;
diff -r e03d1005e484 -r 60526e46625c tools/libxl/xl.h
--- a/tools/libxl/xl.h  Mon Feb 13 17:32:21 2012 +0000
+++ b/tools/libxl/xl.h  Mon Feb 13 17:45:13 2012 +0000
@@ -110,6 +110,7 @@
 extern int dryrun_only;
 extern char *lockfile;
 extern char *default_vifscript;
+extern char *default_bridge;
 
 enum output_format {
     OUTPUT_FORMAT_JSON,
diff -r e03d1005e484 -r 60526e46625c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Feb 13 17:32:21 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Mon Feb 13 17:45:13 2012 +0000
@@ -840,6 +840,11 @@
                 nic->script = strdup(default_vifscript);
             }
 
+           if (default_bridge) {
+               free(nic->bridge);
+               nic->bridge = strdup(default_bridge);
+           }
+
             p = strtok(buf2, ",");
             if (!p)
                 goto skip;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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