Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 39b1e237f5..ef7eed5682 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9133,29 +9133,14 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def,
}
VIR_FREE(tmp);
- if ((tmp = virXMLPropString(cur, "ioeventfd")) &&
- (def->ioeventfd = virTristateSwitchTypeFromString(tmp)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown disk ioeventfd mode '%s'"), tmp);
+ if (virXMLPropTristateSwitch(cur, "ioeventfd", false,
&def->ioeventfd) < 0)
return -1;
- }
- VIR_FREE(tmp);
- if ((tmp = virXMLPropString(cur, "event_idx")) &&
- (def->event_idx = virTristateSwitchTypeFromString(tmp)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown disk event_idx mode '%s'"), tmp);
+ if (virXMLPropTristateSwitch(cur, "event_idx", false,
&def->event_idx) < 0)
return -1;
- }
- VIR_FREE(tmp);
- if ((tmp = virXMLPropString(cur, "copy_on_read")) &&
- (def->copy_on_read = virTristateSwitchTypeFromString(tmp)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown disk copy_on_read mode '%s'"), tmp);
+ if (virXMLPropTristateSwitch(cur, "copy_on_read", false,
&def->copy_on_read) < 0)
return -1;
- }
- VIR_FREE(tmp);
if ((tmp = virXMLPropString(cur, "discard")) &&
(def->discard = virDomainDiskDiscardTypeFromString(tmp)) <= 0) {
--
2.26.2