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

util: eliminate superfluous saveVlan check in virNetDevSetNetConfig()

Commit 81fb440b further qualified an if statement by adding the
boolean saveVlan to the condition. Coverity pointed out that this
change in the logic eliminated the need to check saveVlan in an
argument to virAsprintf().
上级 83074cc9
...@@ -1936,10 +1936,8 @@ virNetDevSaveNetConfig(const char *linkdev, int vf, ...@@ -1936,10 +1936,8 @@ virNetDevSaveNetConfig(const char *linkdev, int vf,
goto cleanup; goto cleanup;
/* get admin MAC and vlan tag */ /* get admin MAC and vlan tag */
if (virNetDevGetVfConfig(pfDevName, vf, &oldMAC, if (virNetDevGetVfConfig(pfDevName, vf, &oldMAC, &oldVlanTag) < 0)
saveVlan ? &oldVlanTag : NULL) < 0) {
goto cleanup; goto cleanup;
}
if (virJSONValueObjectAppendString(configJSON, if (virJSONValueObjectAppendString(configJSON,
VIR_NETDEV_KEYNAME_ADMIN_MAC, VIR_NETDEV_KEYNAME_ADMIN_MAC,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册