1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

conf: rename 'name' in scheduler parser

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>
This commit is contained in:
Ján Tomko 2020-07-25 09:29:36 +02:00
parent 31c69e188c
commit dd44868423

View 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;
}