]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: rename 'name' in scheduler parser
authorJán Tomko <jtomko@redhat.com>
Sat, 25 Jul 2020 07:29:36 +0000 (09:29 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 05:23:45 +0000 (07:23 +0200)
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@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c

index 386b04b5b8f04744cc219e9c3cbc6e5548323420..fd968635fe2adcc585f43ace21e44283f4e869b1 100644 (file)
@@ -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;
         }