From: Laine Stump Date: Fri, 17 Jun 2016 18:52:48 +0000 (-0400) Subject: lxc: support setting host-side IP addresses/routes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cd5c9f21ded4f8e6216eba02b8795f70503ab404;p=libvirt.git lxc: support setting host-side IP addresses/routes --- diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 07eb22af02..28313f0f77 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -304,6 +304,14 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, if (virNetDevSetOnline(parentVeth, true) < 0) goto cleanup; + if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_ETHERNET) { + /* Set IP info for the host side, but only if the type is + * 'ethernet'. + */ + if (virNetDevIPInfoAddToDev(parentVeth, &net->hostIP) < 0) + goto cleanup; + } + if (net->filter && virDomainConfNWFilterInstantiate(vm->uuid, net) < 0) goto cleanup;