提交 92a83040 编写于 作者: L Laine Stump

conf: output forward device connections count in network XML

It may be useful for management applications to know which physical
network devices are in use by guests. This information is already
available in the network objects, but wasn't output in the XML. This
patch outputs it when the INACTIVE flag isn't set (and if it's non-0).
上级 643feae7
......@@ -1495,8 +1495,14 @@ char *virNetworkDefFormat(const virNetworkDefPtr def, unsigned int flags)
if (def->nForwardIfs &&
(!def->nForwardPfs || !(flags & VIR_NETWORK_XML_INACTIVE))) {
for (ii = 0; ii < def->nForwardIfs; ii++) {
virBufferEscapeString(&buf, " <interface dev='%s'/>\n",
virBufferEscapeString(&buf, " <interface dev='%s'",
def->forwardIfs[ii].dev);
if (!(flags & VIR_NETWORK_XML_INACTIVE) &&
(def->forwardIfs[ii].connections > 0)) {
virBufferAsprintf(&buf, " connections='%d'",
def->forwardIfs[ii].connections);
}
virBufferAddLit(&buf, "/>\n");
}
}
if (def->nForwardPfs || def->nForwardIfs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册