提交 db7f2628 编写于 作者: L Laine Stump

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: NLaine Stump <laine@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 2b8fd733
无相关合并请求
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部