[libvirt PATCH 1/3] conf: rename 'name' in scheduler parser

Ján Tomko jtomko at redhat.com
Mon Jul 27 13:15:44 UTC 2020


virDomainThreadSchedParseHelper is used for parsing both iothread
and vcpu scheduling settings. Rename its 'name' attribute to
make it obvious this refers to the attribute name, not the name of
the element (which is currently constructed from the attribute name).

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/conf/domain_conf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 386b04b5b8..fd968635fe 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19965,17 +19965,17 @@ virDomainEmulatorSchedParse(xmlNodePtr node,
 
 static virBitmapPtr
 virDomainSchedulerParse(xmlNodePtr node,
-                        const char *name,
+                        const char *attributeName,
                         virProcessSchedPolicy *policy,
                         int *priority)
 {
     virBitmapPtr ret = NULL;
     g_autofree char *tmp = NULL;
 
-    if (!(tmp = virXMLPropString(node, name))) {
+    if (!(tmp = virXMLPropString(node, attributeName))) {
         virReportError(VIR_ERR_XML_ERROR,
                        _("Missing attribute '%s' in element '%sched'"),
-                       name, name);
+                       attributeName, attributeName);
         goto error;
     }
 
@@ -19985,7 +19985,7 @@ virDomainSchedulerParse(xmlNodePtr node,
     if (virBitmapIsAllClear(ret)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("'%s' scheduler bitmap '%s' is empty"),
-                       name, tmp);
+                       attributeName, tmp);
         goto error;
     }
 
@@ -20002,7 +20002,7 @@ virDomainSchedulerParse(xmlNodePtr node,
 
 static int
 virDomainThreadSchedParseHelper(xmlNodePtr node,
-                                const char *name,
+                                const char *attributeName,
                                 virDomainThreadSchedParamPtr (*func)(virDomainDefPtr, unsigned int),
                                 virDomainDefPtr def)
 {
@@ -20012,7 +20012,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
     int priority = 0;
     g_autoptr(virBitmap) map = NULL;
 
-    if (!(map = virDomainSchedulerParse(node, name, &policy, &priority)))
+    if (!(map = virDomainSchedulerParse(node, attributeName, &policy, &priority)))
         return -1;
 
     while ((next = virBitmapNextSetBit(map, next)) > -1) {
@@ -20022,7 +20022,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
         if (sched->policy != VIR_PROC_POLICY_NONE) {
             virReportError(VIR_ERR_XML_DETAIL,
                            _("%ssched attributes 'vcpus' must not overlap"),
-                           STREQ(name, "vcpus") ? "vcpu" : name);
+                           STREQ(attributeName, "vcpus") ? "vcpu" : attributeName);
             return -1;
         }
 
-- 
2.26.2




More information about the libvir-list mailing list