static virBitmapPtr
virDomainSchedulerParse(xmlNodePtr node,
+ const char *elementName,
const char *attributeName,
virProcessSchedPolicy *policy,
int *priority)
if (!(tmp = virXMLPropString(node, attributeName))) {
virReportError(VIR_ERR_XML_ERROR,
- _("Missing attribute '%s' in element '%sched'"),
- attributeName, attributeName);
+ _("Missing attribute '%s' in element '%s'"),
+ attributeName, elementName);
goto error;
}
static int
virDomainThreadSchedParseHelper(xmlNodePtr node,
+ const char *elementName,
const char *attributeName,
virDomainThreadSchedParamPtr (*func)(virDomainDefPtr, unsigned int),
virDomainDefPtr def)
int priority = 0;
g_autoptr(virBitmap) map = NULL;
- if (!(map = virDomainSchedulerParse(node, attributeName, &policy, &priority)))
+ if (!(map = virDomainSchedulerParse(node, elementName, attributeName,
+ &policy, &priority)))
return -1;
while ((next = virBitmapNextSetBit(map, next)) > -1) {
if (sched->policy != VIR_PROC_POLICY_NONE) {
virReportError(VIR_ERR_XML_DETAIL,
- _("%ssched attributes 'vcpus' must not overlap"),
- STREQ(attributeName, "vcpus") ? "vcpu" : attributeName);
+ _("'%s' attributes 'vcpus' must not overlap"),
+ elementName);
return -1;
}
virDomainVcpuThreadSchedParse(xmlNodePtr node,
virDomainDefPtr def)
{
- return virDomainThreadSchedParseHelper(node, "vcpus",
+ return virDomainThreadSchedParseHelper(node,
+ "vcpusched",
+ "vcpus",
virDomainDefGetVcpuSched,
def);
}
virDomainIOThreadSchedParse(xmlNodePtr node,
virDomainDefPtr def)
{
- return virDomainThreadSchedParseHelper(node, "iothreads",
+ return virDomainThreadSchedParseHelper(node,
+ "iothreadsched",
+ "iothreads",
virDomainDefGetIOThreadSched,
def);
}