Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 55920e7a7d..e3e38ae30d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8428,7 +8428,7 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
g_autofree char *type = NULL;
g_autofree char *namespc = NULL;
- g_autofree char *managed = NULL;
+ virTristateBool managed = VIR_TRISTATE_BOOL_ABSENT;
xmlNodePtr address;
nvme = g_new0(virStorageSourceNVMeDef, 1);
@@ -8459,14 +8459,9 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
return -1;
}
- if ((managed = virXMLPropString(node, "managed"))) {
- if ((nvme->managed = virTristateBoolTypeFromString(managed)) <= 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("malformed managed value '%s'"),
- managed);
- return -1;
- }
- }
+ if (virXMLPropYesNo(node, "managed", &managed) < 0)
+ return -1;
+ nvme->managed = managed;
if (!(address = virXPathNode("./address", ctxt))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
--
2.26.2