[libvirt] [PATCH v2 03/11] conf: net: Rename 'model' to 'modelstr'

Cole Robinson crobinso at redhat.com
Wed Mar 13 15:51:12 UTC 2019


We will be adding a 'model' enum in upcoming patches. Rename
the existing value to make the differentiation clear

Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 src/conf/domain_conf.c | 16 ++++++++--------
 src/conf/domain_conf.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d282b4d3ae..fe1945b644 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2227,7 +2227,7 @@ virDomainNetDefClear(virDomainNetDefPtr def)
     if (!def)
         return;
 
-    VIR_FREE(def->model);
+    VIR_FREE(def->modelstr);
 
     switch (def->type) {
     case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
@@ -11495,7 +11495,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                            _("Model name contains invalid characters"));
             goto error;
         }
-        VIR_STEAL_PTR(def->model, model);
+        VIR_STEAL_PTR(def->modelstr, model);
     }
 
     switch (def->type) {
@@ -21732,10 +21732,10 @@ virDomainNetDefCheckABIStability(virDomainNetDefPtr src,
         return false;
     }
 
-    if (STRNEQ_NULLABLE(src->model, dst->model)) {
+    if (STRNEQ_NULLABLE(src->modelstr, dst->modelstr)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("Target network card model %s does not match source %s"),
-                       NULLSTR(dst->model), NULLSTR(src->model));
+                       NULLSTR(dst->modelstr), NULLSTR(src->modelstr));
         return false;
     }
 
@@ -29379,28 +29379,28 @@ virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface)
 const char *
 virDomainNetGetModelString(const virDomainNetDef *net)
 {
-    return net->model;
+    return net->modelstr;
 }
 
 int
 virDomainNetSetModelString(virDomainNetDefPtr net,
                            const char *model)
 {
-    return VIR_STRDUP(net->model, model);
+    return VIR_STRDUP(net->modelstr, model);
 }
 
 int
 virDomainNetStreqModelString(const virDomainNetDef *net,
                              const char *model)
 {
-    return STREQ_NULLABLE(net->model, model);
+    return STREQ_NULLABLE(net->modelstr, model);
 }
 
 int
 virDomainNetStrcaseeqModelString(const virDomainNetDef *net,
                                  const char *model)
 {
-    return net->model && STRCASEEQ(net->model, model);
+    return net->modelstr && STRCASEEQ(net->modelstr, model);
 }
 
 bool
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 39618928f7..a0d443ee1b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1021,7 +1021,7 @@ struct _virDomainNetDef {
     virDomainNetType type;
     virMacAddr mac;
     bool mac_generated; /* true if mac was *just now* auto-generated by libvirt */
-    char *model;
+    char *modelstr;
     union {
         struct {
             virDomainNetBackendType name; /* which driver backend to use */
-- 
2.20.1




More information about the libvir-list mailing list