From: Roger Pau Monne Date: Wed, 13 Mar 2013 17:42:17 +0000 (+0000) Subject: xl: allow specifying a default gatewaydev in xl.conf X-Git-Tag: 4.3.0-rc1~188 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb724faf0138a92dcebb8cf249ae79ba87a67ff9;p=xen.git 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é Acked-by: Ian Campbell Tested-by: Ulf Kreutzberg Cc: Ulf Kreutzberg Cc: Ian Campbell Cc: George Dunlap Acked-by: Ian Jackson --- diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5 index 82c6b20251..f8f7e7fc79 100644 --- a/docs/man/xl.conf.pod.5 +++ b/docs/man/xl.conf.pod.5 @@ -82,6 +82,12 @@ Configures the default bridge to set for virtual network devices. Default: C +=item B + +Configures the default gateway device to set for virtual network devices. + +Default: C + =item B Configures the default output format used by xl when printing "machine diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf index 28ab796ea3..9a03ffffe3 100644 --- a/tools/examples/xl.conf +++ b/tools/examples/xl.conf @@ -20,3 +20,6 @@ # if disabled the old behaviour will be used, and hotplug scripts will be # launched by udev. #run_hotplug_scripts=1 + +# 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 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: + * + * .default.