提交 d22591ef 编写于 作者: L Laine Stump 提交者: Matthias Bolte

Support delay property in interface bridge xml.

上级 3aa13a47
......@@ -801,6 +801,7 @@ virInterfaceDefParseXML(virConnectPtr conn, xmlXPathContextPtr ctxt) {
}
VIR_FREE(tmp);
}
def->data.bridge.delay = virXMLPropString(bridge, "delay");
ctxt->node = bridge;
virInterfaceDefParseBridge(conn, def, ctxt);
break;
......@@ -1038,12 +1039,14 @@ virInterfaceBridgeDefFormat(virConnectPtr conn, virBufferPtr buf,
int i;
int ret = 0;
virBufferAddLit(buf, " <bridge");
if (def->data.bridge.stp == 1)
virBufferAddLit(buf, " <bridge stp='on'>\n");
virBufferAddLit(buf, " stp='on'");
else if (def->data.bridge.stp == 0)
virBufferAddLit(buf, " <bridge stp='off'>\n");
else
virBufferAddLit(buf, " <bridge>\n");
virBufferAddLit(buf, " stp='off'");
if (def->data.bridge.delay != NULL)
virBufferVSprintf(buf, " delay='%s'", def->data.bridge.delay);
virBufferAddLit(buf, ">\n");
for (i = 0;i < def->data.bridge.nbItf;i++) {
if (virInterfaceBareDevDefFormat(conn, buf, def->data.bridge.itf[i])
......
......@@ -97,6 +97,7 @@ typedef struct _virInterfaceBridgeDef virInterfaceBridgeDef;
typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr;
struct _virInterfaceBridgeDef {
int stp; /* 0, 1 or -1 if undefined */
char *delay;
int nbItf; /* number of defined interfaces */
virInterfaceBareDefPtr *itf;/* interfaces */
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册