diff mbox series

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

Message ID c36227c80846d2929499c955a2b8e0ac4092a0ab.1552492022.git.crobinso@redhat.com
State Accepted
Commit aa3c9f34bfc6ee03b9c66758c181f9f3c048c902
Headers show
Series conf: partial net model enum conversion | expand

Commit Message

Cole Robinson March 13, 2019, 3:51 p.m. UTC
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
diff mbox series

Patch

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 */