mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: support updating <port isolated='yes|no'/> during device update
This setting can be updating very easily on an already active interface by just changing it in sysfs. If the bridge used for connection is also changed, there is no need to separately update it, because the new setting isf done as a part of connecting to the bridge anyway. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2b8fd7334d
commit
db7f262884
@ -3481,6 +3481,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
bool needBandwidthSet = false;
|
||||
bool needCoalesceChange = false;
|
||||
bool needVlanUpdate = false;
|
||||
bool needIsolatedPortChange = false;
|
||||
int ret = -1;
|
||||
int changeidx = -1;
|
||||
g_autoptr(virConnect) conn = NULL;
|
||||
@ -3805,6 +3806,11 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
needVlanUpdate = true;
|
||||
}
|
||||
|
||||
if (virDomainNetGetActualPortOptionsIsolated(olddev) !=
|
||||
virDomainNetGetActualPortOptionsIsolated(newdev)) {
|
||||
needIsolatedPortChange = true;
|
||||
}
|
||||
|
||||
if (olddev->linkstate != newdev->linkstate)
|
||||
needLinkStateChange = true;
|
||||
|
||||
@ -3851,6 +3857,20 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
* determined that the rest of newdev is equivalent to olddev,
|
||||
* so move newdev into place */
|
||||
needReplaceDevDef = true;
|
||||
|
||||
/* this is already updated as a part of reconnecting the bridge */
|
||||
needIsolatedPortChange = false;
|
||||
}
|
||||
|
||||
if (needIsolatedPortChange) {
|
||||
const char *bridge = virDomainNetGetActualBridgeName(newdev);
|
||||
bool isolatedOn = (virDomainNetGetActualPortOptionsIsolated(newdev) ==
|
||||
VIR_TRISTATE_BOOL_YES);
|
||||
|
||||
if (virNetDevBridgePortSetIsolated(bridge, newdev->ifname, isolatedOn) < 0)
|
||||
goto cleanup;
|
||||
|
||||
needReplaceDevDef = true;
|
||||
}
|
||||
|
||||
if (needFilterChange) {
|
||||
|
Loading…
Reference in New Issue
Block a user