mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
lxc: don't up the veth interfaces unless explicitly asked to
Upping an interface for no reason and not configuring it is a cardinal sin. With the default addrgenmode if eui64 it sticks a link-local address to the interface. That is not good, as NetworkManager would see an address configured, assume the interface is already configured and won't touch it iself and the interface might stay unconfigured until the end of the days. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1124721 Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
808e771e83
commit
c3cf3c43a0
@ -541,7 +541,8 @@ static int lxcContainerRenameAndEnableInterfaces(virDomainDefPtr vmDef,
|
|||||||
VIR_FREE(ipStr);
|
VIR_FREE(ipStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (netDef->linkstate != VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
|
if (netDef->nips ||
|
||||||
|
netDef->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP) {
|
||||||
VIR_DEBUG("Enabling %s", newname);
|
VIR_DEBUG("Enabling %s", newname);
|
||||||
rc = virNetDevSetOnline(newname, true);
|
rc = virNetDevSetOnline(newname, true);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@ -348,12 +348,10 @@ lxcCreateNetDef(const char *type,
|
|||||||
if (VIR_ALLOC(net) < 0)
|
if (VIR_ALLOC(net) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (flag) {
|
if (STREQ_NULLABLE(flag, "up"))
|
||||||
if (STREQ(flag, "up"))
|
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
|
||||||
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
|
else
|
||||||
else
|
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
|
||||||
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VIR_STRDUP(net->ifname_guest, name) < 0)
|
if (VIR_STRDUP(net->ifname_guest, name) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user