Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 483df91880..b3ef2db3fa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18764,19 +18764,9 @@ virDomainResctrlMonDefParse(virDomainDef *def,
}
if (tag == VIR_RESCTRL_MONITOR_TYPE_CACHE) {
- tmp = virXMLPropString(nodes[i], "level");
- if (!tmp) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("Missing monitor attribute
'level'"));
+ if (virXMLPropUInt(nodes[i], "level", 10, VIR_XML_PROP_REQUIRED,
+ &level) < 0)
goto cleanup;
- }
-
- if (virStrToLong_uip(tmp, NULL, 10, &level) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("Invalid monitor attribute 'level' value
'%s'"),
- tmp);
- goto cleanup;
- }
if (level != VIR_DOMAIN_RESCTRL_MONITOR_CACHELEVEL) {
virReportError(VIR_ERR_XML_ERROR,
@@ -18784,8 +18774,6 @@ virDomainResctrlMonDefParse(virDomainDef *def,
level);
goto cleanup;
}
-
- VIR_FREE(tmp);
}
if (virDomainResctrlParseVcpus(def, nodes[i], &domresmon->vcpus) < 0)
--
2.26.3