mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Revert "network: use 'bridge' as actual type instead of 'network'"
This caused the live XML to report the 'bridge' type instead of the 'network' type, which is a behavioural regression. It also breaks 'virsh domif-setlink', 'virsh update-device' and 'virsh domiftune' This reverts commit 518026e15959ab0e19b659a9f2ff502a54946498. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
e007e8ba3a
commit
04e4307d34
@ -5128,19 +5128,6 @@ virDomainNetDefPostParse(virDomainNetDefPtr net)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Older libvirtd uses actualType==network, but we now
|
|
||||||
* just use actualType==bridge, as nothing needs to
|
|
||||||
* distinguish the two cases, and this simplifies virt
|
|
||||||
* drive code */
|
|
||||||
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
|
|
||||||
net->data.network.actual != NULL &&
|
|
||||||
net->data.network.actual->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
|
||||||
char mac[VIR_MAC_STRING_BUFLEN];
|
|
||||||
virMacAddrFormat(&net->mac, mac);
|
|
||||||
VIR_DEBUG("Updating NIC %s actual type to bridge", mac);
|
|
||||||
net->data.network.actual->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11281,21 +11268,11 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bandwidth_node = virXPathNode("./bandwidth", ctxt);
|
bandwidth_node = virXPathNode("./bandwidth", ctxt);
|
||||||
if (bandwidth_node) {
|
if (bandwidth_node &&
|
||||||
/* type == NETWORK is legacy config, converted to BRIDGE
|
virNetDevBandwidthParse(&actual->bandwidth,
|
||||||
* in post-parse function, but this code runs before
|
bandwidth_node,
|
||||||
* post-parse logic, so we must account for configs still
|
actual->type == VIR_DOMAIN_NET_TYPE_NETWORK) < 0)
|
||||||
* using legacy type == NETWORK
|
goto error;
|
||||||
*/
|
|
||||||
bool allowFloor =
|
|
||||||
(actual->type == VIR_DOMAIN_NET_TYPE_NETWORK) ||
|
|
||||||
(actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE &&
|
|
||||||
actual->data.bridge.brname != NULL);
|
|
||||||
if (virNetDevBandwidthParse(&actual->bandwidth,
|
|
||||||
bandwidth_node,
|
|
||||||
allowFloor) < 0)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
vlanNode = virXPathNode("./vlan", ctxt);
|
vlanNode = virXPathNode("./vlan", ctxt);
|
||||||
if (vlanNode && virNetDevVlanParse(vlanNode, ctxt, &actual->vlan) < 0)
|
if (vlanNode && virNetDevVlanParse(vlanNode, ctxt, &actual->vlan) < 0)
|
||||||
|
@ -4489,7 +4489,11 @@ networkAllocateActualDevice(virNetworkPtr net,
|
|||||||
case VIR_NETWORK_FORWARD_NAT:
|
case VIR_NETWORK_FORWARD_NAT:
|
||||||
case VIR_NETWORK_FORWARD_ROUTE:
|
case VIR_NETWORK_FORWARD_ROUTE:
|
||||||
case VIR_NETWORK_FORWARD_OPEN:
|
case VIR_NETWORK_FORWARD_OPEN:
|
||||||
iface->data.network.actual->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
|
/* for these forward types, the actual net type really *is*
|
||||||
|
* NETWORK; we just keep the info from the portgroup in
|
||||||
|
* iface->data.network.actual
|
||||||
|
*/
|
||||||
|
iface->data.network.actual->type = VIR_DOMAIN_NET_TYPE_NETWORK;
|
||||||
|
|
||||||
/* we also store the bridge device and macTableManager settings
|
/* we also store the bridge device and macTableManager settings
|
||||||
* in iface->data.network.actual->data.bridge for later use
|
* in iface->data.network.actual->data.bridge for later use
|
||||||
@ -5433,8 +5437,9 @@ networkBandwidthGenericChecks(virDomainNetDefPtr iface,
|
|||||||
virNetDevBandwidthPtr ifaceBand;
|
virNetDevBandwidthPtr ifaceBand;
|
||||||
unsigned long long old_floor, new_floor;
|
unsigned long long old_floor, new_floor;
|
||||||
|
|
||||||
if (virDomainNetGetActualType(iface) != VIR_DOMAIN_NET_TYPE_BRIDGE ||
|
if (virDomainNetGetActualType(iface) != VIR_DOMAIN_NET_TYPE_NETWORK &&
|
||||||
iface->data.network.actual->data.bridge.brname == NULL) {
|
(virDomainNetGetActualType(iface) != VIR_DOMAIN_NET_TYPE_BRIDGE ||
|
||||||
|
iface->data.network.actual->data.bridge.brname == NULL)) {
|
||||||
/* This is not an interface that's plugged into a network.
|
/* This is not an interface that's plugged into a network.
|
||||||
* We don't care. Thus from our POV bandwidth change is allowed. */
|
* We don't care. Thus from our POV bandwidth change is allowed. */
|
||||||
return false;
|
return false;
|
||||||
|
@ -4567,7 +4567,7 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver,
|
|||||||
syncNicRxFilterDeviceOptions(def->ifname, guestFilter, hostFilter);
|
syncNicRxFilterDeviceOptions(def->ifname, guestFilter, hostFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainNetGetActualType(def) == VIR_DOMAIN_NET_TYPE_BRIDGE) {
|
if (virDomainNetGetActualType(def) == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
||||||
const char *brname = virDomainNetGetActualBridgeName(def);
|
const char *brname = virDomainNetGetActualBridgeName(def);
|
||||||
|
|
||||||
/* For libivrt network connections, set the following TUN/TAP network
|
/* For libivrt network connections, set the following TUN/TAP network
|
||||||
|
@ -458,7 +458,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:36:bd:3b'/>
|
<mac address='52:54:00:36:bd:3b'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
@ -329,7 +329,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:59:59:91'/>
|
<mac address='52:54:00:59:59:91'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
@ -370,7 +370,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:36:bd:3b'/>
|
<mac address='52:54:00:36:bd:3b'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
@ -407,7 +407,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:36:bd:3b'/>
|
<mac address='52:54:00:36:bd:3b'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
@ -343,7 +343,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:59:59:91'/>
|
<mac address='52:54:00:59:59:91'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
@ -390,7 +390,7 @@
|
|||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:36:bd:3b'/>
|
<mac address='52:54:00:36:bd:3b'/>
|
||||||
<source network='default'/>
|
<source network='default'/>
|
||||||
<actual type='bridge'>
|
<actual type='network'>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
</actual>
|
</actual>
|
||||||
<target dev='vnet0'/>
|
<target dev='vnet0'/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user