[libvirt] [PATCH 4/4] cleanup: Change datatype of net->stp to boolean

Osier Yang jyang at redhat.com
Fri Apr 12 09:21:05 UTC 2013


---
 src/conf/network_conf.c | 2 +-
 src/conf/network_conf.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 968cf11..75584a0 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1748,7 +1748,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
     /* Parse bridge information */
     def->bridge = virXPathString("string(./bridge[1]/@name)", 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)
         def->delay = 0;
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 6ce9a00..1a86e3d 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -195,7 +195,7 @@ struct _virNetworkDef {
     char *bridge;       /* Name of bridge device */
     char *domain;
     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 */
     bool mac_specified;
 
-- 
1.8.1.4




More information about the libvir-list mailing list