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); VIR_FREE(tmp);
} }
def->data.bridge.delay = virXMLPropString(bridge, "delay");
ctxt->node = bridge; ctxt->node = bridge;
virInterfaceDefParseBridge(conn, def, ctxt); virInterfaceDefParseBridge(conn, def, ctxt);
break; break;
@ -1038,12 +1039,14 @@ virInterfaceBridgeDefFormat(virConnectPtr conn, virBufferPtr buf,
int i; int i;
int ret = 0; int ret = 0;
virBufferAddLit(buf, " <bridge");
if (def->data.bridge.stp == 1) if (def->data.bridge.stp == 1)
virBufferAddLit(buf, " <bridge stp='on'>\n"); virBufferAddLit(buf, " stp='on'");
else if (def->data.bridge.stp == 0) else if (def->data.bridge.stp == 0)
virBufferAddLit(buf, " <bridge stp='off'>\n"); virBufferAddLit(buf, " stp='off'");
else if (def->data.bridge.delay != NULL)
virBufferAddLit(buf, " <bridge>\n"); virBufferVSprintf(buf, " delay='%s'", def->data.bridge.delay);
virBufferAddLit(buf, ">\n");
for (i = 0;i < def->data.bridge.nbItf;i++) { for (i = 0;i < def->data.bridge.nbItf;i++) {
if (virInterfaceBareDevDefFormat(conn, buf, def->data.bridge.itf[i]) if (virInterfaceBareDevDefFormat(conn, buf, def->data.bridge.itf[i])

View File

@ -97,6 +97,7 @@ typedef struct _virInterfaceBridgeDef virInterfaceBridgeDef;
typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr; typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr;
struct _virInterfaceBridgeDef { struct _virInterfaceBridgeDef {
int stp; /* 0, 1 or -1 if undefined */ int stp; /* 0, 1 or -1 if undefined */
char *delay;
int nbItf; /* number of defined interfaces */ int nbItf; /* number of defined interfaces */
virInterfaceBareDefPtr *itf;/* interfaces */ virInterfaceBareDefPtr *itf;/* interfaces */
}; };