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