cleanup: Change datatype of net->stp to boolean

This commit is contained in:
Osier Yang 2013-04-12 17:08:59 +08:00
parent f2adc3b435
commit 93002b9827
2 changed files with 2 additions and 2 deletions

View File

@ -1748,7 +1748,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
/* Parse bridge information */ /* Parse bridge information */
def->bridge = virXPathString("string(./bridge[1]/@name)", ctxt); def->bridge = virXPathString("string(./bridge[1]/@name)", ctxt);
stp = virXPathString("string(./bridge[1]/@stp)", ctxt); stp = virXPathString("string(./bridge[1]/@stp)", ctxt);
def->stp = (stp && STREQ(stp, "off")) ? 0 : 1; def->stp = (stp && STREQ(stp, "off")) ? false : true;
if (virXPathULong("string(./bridge[1]/@delay)", ctxt, &def->delay) < 0) if (virXPathULong("string(./bridge[1]/@delay)", ctxt, &def->delay) < 0)
def->delay = 0; def->delay = 0;

View File

@ -195,7 +195,7 @@ struct _virNetworkDef {
char *bridge; /* Name of bridge device */ char *bridge; /* Name of bridge device */
char *domain; char *domain;
unsigned long delay; /* Bridge forward delay (ms) */ unsigned long delay; /* Bridge forward delay (ms) */
unsigned int stp :1; /* Spanning tree protocol */ bool stp; /* Spanning tree protocol */
virMacAddr mac; /* mac address of bridge device */ virMacAddr mac; /* mac address of bridge device */
bool mac_specified; bool mac_specified;