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

[Xen-changelog] [xen master] libxl: Add vif.default.backend to xl.conf



commit 61917a0802b93cebd596c6c71aa13df428149f67
Author:     George Dunlap <george.dunlap@xxxxxxxxxxxxx>
AuthorDate: Fri Jul 5 12:13:55 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Jul 22 22:20:59 2013 +0100

    libxl: Add vif.default.backend to xl.conf
    
    This will allow a user to default to a network driver domain
    system-wide.
    
    Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 docs/man/xl.conf.pod.5   |    6 ++++++
 tools/examples/xl.conf   |    4 ++++
 tools/libxl/xl.c         |    4 ++++
 tools/libxl/xl.h         |    1 +
 tools/libxl/xl_cmdimpl.c |    6 ++++++
 5 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index 125f786..7c43bde 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -93,6 +93,12 @@ The old B<defaultbridge> option is deprecated and should not 
be used.
 
 Default: C<xenbr0>
 
+=item B<vif.default.backend="NAME">
+
+Configures the default backend to set for virtual network devices.
+
+Default: C<0>
+
 =item B<vif.default.gatewaydev="NAME">
 
 Configures the default gateway device to set for virtual network devices.
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index 12ea737..374b6bb 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -19,6 +19,10 @@
 # launched by udev.
 #run_hotplug_scripts=1
 
+# default backend domain to connect guest vifs to.  This can be any
+# valid domain identifier.
+#vif.default.backend="0"
+
 # default gateway device to use with vif-route hotplug script
 #vif.default.gatewaydev="eth0"
 
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 0750f60..b965cab 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -45,6 +45,7 @@ char *lockfile;
 char *default_vifscript = NULL;
 char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
+char *default_vifbackend = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 int claim_mode = 1;
 
@@ -158,6 +159,9 @@ static void parse_global_config(const char *configfile,
     if (!xlu_cfg_get_string (config, "vif.default.gatewaydev", &buf, 0))
         default_gatewaydev = strdup(buf);
 
+    if (!xlu_cfg_get_string (config, "vif.default.backend", &buf, 0))
+        default_vifbackend = strdup(buf);
+
     if (!xlu_cfg_get_string (config, "output_format", &buf, 0)) {
         if (!strcmp(buf, "json"))
             default_output_format = OUTPUT_FORMAT_JSON;
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 5ad3e17..e72a7d2 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -151,6 +151,7 @@ extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
 extern char *default_gatewaydev;
+extern char *default_vifbackend;
 extern char *blkdev_start;
 
 enum output_format {
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4a8feaf..5bef969 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1125,6 +1125,11 @@ static void parse_config_data(const char *config_source,
                 nic->gatewaydev = strdup(default_gatewaydev);
             }
 
+            if (default_vifbackend) {
+                free(nic->backend_domname);
+                nic->backend_domname = strdup(default_vifbackend);
+            }
+
             p = strtok(buf2, ",");
             if (!p)
                 goto skip_nic;
@@ -1174,6 +1179,7 @@ static void parse_config_data(const char *config_source,
                     free(nic->ifname);
                     nic->ifname = strdup(p2 + 1);
                 } else if (!strcmp(p, "backend")) {
+                    free(nic->backend_domname);
                     nic->backend_domname = strdup(p2 + 1);
                 } else if (!strcmp(p, "rate")) {
                     parse_vif_rate(&config, (p2 + 1), nic);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.