Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 16 ++++++++++------
src/conf/domain_conf.h | 2 +-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4a0358831b..0b12ec61f9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8988,12 +8988,16 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
}
VIR_FREE(tmp);
- if ((tmp = virXMLPropString(cur, "rerror_policy")) &&
- (((def->rerror_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0)
||
- (def->rerror_policy == VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE))) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown disk read error policy '%s'"), tmp);
- return -1;
+ if ((tmp = virXMLPropString(cur, "rerror_policy"))) {
+ int rerror_policy;
+
+ if (((rerror_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0) ||
+ (rerror_policy == VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown disk read error policy '%s'"),
tmp);
+ return -1;
+ }
+ def->rerror_policy = rerror_policy;
}
VIR_FREE(tmp);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cacb9d0430..d808f5b260 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -568,7 +568,7 @@ struct _virDomainDiskDef {
char *product;
virDomainDiskCache cachemode;
virDomainDiskErrorPolicy error_policy;
- int rerror_policy; /* enum virDomainDiskErrorPolicy */
+ virDomainDiskErrorPolicy rerror_policy;
int iomode; /* enum virDomainDiskIo */
virTristateSwitch ioeventfd;
virTristateSwitch event_idx;
--
2.26.3