mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00: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:
parent
31c69e188c
commit
dd44868423
@ -19965,17 +19965,17 @@ virDomainEmulatorSchedParse(xmlNodePtr node,
|
|||||||
|
|
||||||
static virBitmapPtr
|
static virBitmapPtr
|
||||||
virDomainSchedulerParse(xmlNodePtr node,
|
virDomainSchedulerParse(xmlNodePtr node,
|
||||||
const char *name,
|
const char *attributeName,
|
||||||
virProcessSchedPolicy *policy,
|
virProcessSchedPolicy *policy,
|
||||||
int *priority)
|
int *priority)
|
||||||
{
|
{
|
||||||
virBitmapPtr ret = NULL;
|
virBitmapPtr ret = NULL;
|
||||||
g_autofree char *tmp = NULL;
|
g_autofree char *tmp = NULL;
|
||||||
|
|
||||||
if (!(tmp = virXMLPropString(node, name))) {
|
if (!(tmp = virXMLPropString(node, attributeName))) {
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("Missing attribute '%s' in element '%sched'"),
|
_("Missing attribute '%s' in element '%sched'"),
|
||||||
name, name);
|
attributeName, attributeName);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19985,7 +19985,7 @@ virDomainSchedulerParse(xmlNodePtr node,
|
|||||||
if (virBitmapIsAllClear(ret)) {
|
if (virBitmapIsAllClear(ret)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("'%s' scheduler bitmap '%s' is empty"),
|
_("'%s' scheduler bitmap '%s' is empty"),
|
||||||
name, tmp);
|
attributeName, tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20002,7 +20002,7 @@ virDomainSchedulerParse(xmlNodePtr node,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
virDomainThreadSchedParseHelper(xmlNodePtr node,
|
virDomainThreadSchedParseHelper(xmlNodePtr node,
|
||||||
const char *name,
|
const char *attributeName,
|
||||||
virDomainThreadSchedParamPtr (*func)(virDomainDefPtr, unsigned int),
|
virDomainThreadSchedParamPtr (*func)(virDomainDefPtr, unsigned int),
|
||||||
virDomainDefPtr def)
|
virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
@ -20012,7 +20012,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
|
|||||||
int priority = 0;
|
int priority = 0;
|
||||||
g_autoptr(virBitmap) map = NULL;
|
g_autoptr(virBitmap) map = NULL;
|
||||||
|
|
||||||
if (!(map = virDomainSchedulerParse(node, name, &policy, &priority)))
|
if (!(map = virDomainSchedulerParse(node, attributeName, &policy, &priority)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while ((next = virBitmapNextSetBit(map, next)) > -1) {
|
while ((next = virBitmapNextSetBit(map, next)) > -1) {
|
||||||
@ -20022,7 +20022,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
|
|||||||
if (sched->policy != VIR_PROC_POLICY_NONE) {
|
if (sched->policy != VIR_PROC_POLICY_NONE) {
|
||||||
virReportError(VIR_ERR_XML_DETAIL,
|
virReportError(VIR_ERR_XML_DETAIL,
|
||||||
_("%ssched attributes 'vcpus' must not overlap"),
|
_("%ssched attributes 'vcpus' must not overlap"),
|
||||||
STREQ(name, "vcpus") ? "vcpu" : name);
|
STREQ(attributeName, "vcpus") ? "vcpu" : attributeName);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user