Support delay property in interface bridge xml.

This commit is contained in:
Laine Stump 2010-01-01 20:40:23 -05:00 committed by Matthias Bolte
parent 3aa13a471a
commit d22591efb9
2 changed files with 8 additions and 4 deletions

View File

@ -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])

View File

@ -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 */
};