diff options
author | Roger Pau Monne <roger.pau@citrix.com> | 2013-03-13 17:42:17 +0000 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2013-03-15 12:40:25 +0000 |
commit | cb724faf0138a92dcebb8cf249ae79ba87a67ff9 (patch) | |
tree | 43099a2f1f52089377fdb1079451032850a0fec7 /tools/libxl/xl.c | |
parent | e2abe690babf06fc49bdec49b08cb45dd3e09138 (diff) | |
download | xen-cb724faf0138a92dcebb8cf249ae79ba87a67ff9.tar.gz xen-cb724faf0138a92dcebb8cf249ae79ba87a67ff9.tar.bz2 xen-cb724faf0138a92dcebb8cf249ae79ba87a67ff9.zip |
xl: allow specifying a default gatewaydev in xl.conf
This adds a new global option in the xl configuration file called
"vif.default.gatewaydev", that is used to specify the default
gatewaydev to use when none is passed in the vif specification.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de>
Cc: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/xl.c')
-rw-r--r-- | tools/libxl/xl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c index ecbcd3bf1d..71561a49ef 100644 --- a/tools/libxl/xl.c +++ b/tools/libxl/xl.c @@ -43,6 +43,7 @@ int run_hotplug_scripts = 1; char *lockfile; char *default_vifscript = NULL; char *default_bridge = NULL; +char *default_gatewaydev = NULL; enum output_format default_output_format = OUTPUT_FORMAT_JSON; static xentoollog_level minmsglevel = XTL_PROGRESS; @@ -85,12 +86,25 @@ static void parse_global_config(const char *configfile, exit(1); } + /* + * For global options that are related to a specific type of device + * we use the following nomenclature: + * + * <device type>.default.<option name> + * + * This allows us to keep the default options classified for the + * different device kinds. + */ + 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, "vif.default.gatewaydev", &buf, 0)) + default_gatewaydev = strdup(buf); + if (!xlu_cfg_get_string (config, "output_format", &buf, 0)) { if (!strcmp(buf, "json")) default_output_format = OUTPUT_FORMAT_JSON; |