[03/10] conf: net: Rename 'model' to 'modelstr'

Message ID fa57bb74aeb30bc368d6d3780b1205c6ed1160bd.1547851897.git.crobinso@redhat.com
State Superseded
Headers show
Series
  • RFC: conf: partially net model enum conversion
Related show

Commit Message

Cole Robinson Jan. 18, 2019, 11:05 p.m.
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@redhat.com>

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

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 778b842979..25fbf6f64b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2120,7 +2120,7 @@  virDomainNetDefClear(virDomainNetDefPtr def)
     if (!def)
         return;
 
-    VIR_FREE(def->model);
+    VIR_FREE(def->modelstr);
 
     switch (def->type) {
     case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
@@ -11402,7 +11402,7 @@  virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                            _("Model name contains invalid characters"));
             goto error;
         }
-        def->model = model;
+        def->modelstr = model;
         model = NULL;
     }
 
@@ -21971,10 +21971,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;
     }
 
@@ -29841,28 +29841,28 @@  virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface)
 const char *
 virDomainNetGetModelString(const virDomainNetDef *iface)
 {
-    return iface->model;
+    return iface->modelstr;
 }
 
 int
 virDomainNetSetModelString(virDomainNetDefPtr iface,
                            const char *model)
 {
-    return VIR_STRDUP(iface->model, model);
+    return VIR_STRDUP(iface->modelstr, model);
 }
 
 int
 virDomainNetStreqModelString(const virDomainNetDef *iface,
                              const char *model)
 {
-    return STREQ_NULLABLE(iface->model, model);
+    return STREQ_NULLABLE(iface->modelstr, model);
 }
 
 int
 virDomainNetStrcaseeqModelString(const virDomainNetDef *iface,
                                  const char *model)
 {
-    return iface->model && STRCASEEQ(iface->model, model);
+    return iface->modelstr && STRCASEEQ(iface->modelstr, model);
 }
 
 bool
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 8f856c2d14..5400deda4c 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 */