xl: add 'mtu' option to network configuration

This patch adds code to parse a value for MTU from the network configuration
if it is present. The documentation in xl-network-configuration.5.pod is
also modified accordingly.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
This commit is contained in:
Paul Durrant authored and Wei Liu committed 2020-08-27 10:04:25 +00:00
1 parent c7c6de0cb9
commit 812c8e01db
3 files changed
+9 -1

No files matched your search

+6
View File
@@ -249,3 +249,9 @@ on the underlying netback implementation.
Specifies the devid manually instead of letting xl choose the lowest index available.
NOTE: This should not be set unless you have a reason to.
=head2 mtu
Specifies the MTU (i.e. the maximum size of an IP payload, exclusing headers). The
default value is 1500 but, if the VIF is attached to a bridge, it will be set to match
unless overridden by this parameter.
+1 -1
View File
@@ -338,7 +338,7 @@ struct cmd_spec cmd_table[] = {
"Create a new virtual network device",
"<Domain> [type=<type>] [mac=<mac>] [bridge=<bridge>] "
"[ip=<ip>] [script=<script>] [backend=<BackDomain>] [vifname=<name>] "
"[rate=<rate>] [model=<model>] [accel=<accel>]",
"[rate=<rate>] [model=<model>] [accel=<accel>] [mtu=<mtu>]",
},
{ "network-list",
&main_networklist, 0, 0,
+2
View File
@@ -563,6 +563,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
} else if (MATCH_OPTION("devid", token, oparg)) {
nic->devid = parse_ulong(oparg);
} else if (MATCH_OPTION("mtu", token, oparg)) {
nic->mtu = parse_ulong(oparg);
} else {
fprintf(stderr, "unrecognized argument `%s'\n", token);
return 1;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.