From 98fa8f3ef6b3ef4751021505a804bfa4647634b5 Mon Sep 17 00:00:00 2001
From: Laine Stump
Date: Thu, 9 Jun 2016 15:35:08 -0400
Subject: [PATCH] conf: support host-side IP/route information in
This is place as a sub-element of , where other aspects of the
host-side connection to the network device are located (network or
bridge name, udp listen port, etc). It's a bit odd that the interface
we're configuring with this info is itself named in ,
but that ship sailed long ago:
In practice, this will likely only be useful for type='ethernet', so
its presence in any other type of interface is currently forbidden in
the generic device Validate function (but it's been put into the
general population of virDomainNetDef rather than the
ethernet-specific union member so that 1) we can more easily add the
capability to other types if needed, and 2) we can retain the info
when set to an invalid interface type all the way through to
validation and report a proper error, rather than just ignoring it
(which is currently what happens for many other type-specific
settings).
(NB: The already-existing configuration of IP info for the guest-side
of interfaces is in subelements directly under , and the
name of the guest-side interface (when configurable) is in ).
(This patch had been pushed earlier in
commit fe6a77898a38f491403a70cc49925a584101daee, but was reverted in
commit d658456530c1010a49f45865613ed361a0fcc5b4 because it had been
accidentally pushed during the freeze for release 2.0.0)
---
docs/formatdomain.html.in | 26 +++++
docs/schemas/domaincommon.rng | 2 +-
src/conf/domain_conf.c | 101 +++++++++++++++----
src/conf/domain_conf.h | 3 +-
tests/lxcxml2xmldata/lxc-ethernet-hostip.xml | 44 ++++++++
tests/lxcxml2xmltest.c | 1 +
6 files changed, 155 insertions(+), 22 deletions(-)
create mode 100644 tests/lxcxml2xmldata/lxc-ethernet-hostip.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 2347ed9b40..ee6d5e875f 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5015,6 +5015,32 @@ qemu-kvm -net nic,model=? /dev/null
definitions. This is used by the LXC driver.
+ Since 2.1.0 network devices of type
+ "ethernet" can optionally be provided one or more IP addresses
+ and one or more routes to set on the host side of the
+ network device. These are configured as subelements of
+ the <source> element of the interface, and
+ have the same attributes as the similarly named elements used to
+ configure the guest side of the interface (described above).
+