Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/storage_conf.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 2e07c81f8a..7dc528b103 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -605,7 +605,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
goto cleanup;
for (i = 0; i < nsource; i++) {
- g_autofree char *partsep = NULL;
+ virTristateBool partsep = VIR_TRISTATE_BOOL_ABSENT;
virStoragePoolSourceDevice dev = { .path = NULL };
dev.path = virXMLPropString(nodeset[i], "path");
@@ -615,17 +615,11 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
goto cleanup;
}
- partsep = virXMLPropString(nodeset[i], "part_separator");
- if (partsep) {
- dev.part_separator = virTristateBoolTypeFromString(partsep);
- if (dev.part_separator <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("invalid part_separator setting
'%s'"),
- partsep);
- virStoragePoolSourceDeviceClear(&dev);
- goto cleanup;
- }
+ if (virXMLPropYesNo(nodeset[i], "part_separator", &partsep) < 0)
{
+ virStoragePoolSourceDeviceClear(&dev);
+ goto cleanup;
}
+ dev.part_separator = partsep;
if (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 0) {
virStoragePoolSourceDeviceClear(&dev);
--
2.26.2