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 9a4252099e..60f961c2b9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9083,11 +9083,15 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
VIR_FREE(tmp);
}
- if ((tmp = virXMLPropString(cur, "detect_zeroes")) &&
- (def->detect_zeroes = virDomainDiskDetectZeroesTypeFromString(tmp)) <= 0)
{
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown driver detect_zeroes value '%s'"),
tmp);
- return -1;
+ if ((tmp = virXMLPropString(cur, "detect_zeroes"))) {
+ int detect_zeroes;
+
+ if ((detect_zeroes = virDomainDiskDetectZeroesTypeFromString(tmp)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown driver detect_zeroes value
'%s'"), tmp);
+ return -1;
+ }
+ def->detect_zeroes = detect_zeroes;
}
VIR_FREE(tmp);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index eb4991a312..a7cad31896 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -581,7 +581,7 @@ struct _virDomainDiskDef {
virDomainDeviceSGIO sgio;
virDomainDiskDiscard discard;
unsigned int iothread; /* unused = 0, > 0 specific thread # */
- int detect_zeroes; /* enum virDomainDiskDetectZeroes */
+ virDomainDiskDetectZeroes detect_zeroes;
char *domain_name; /* backend domain name */
unsigned int queues;
virDomainDiskModel model;
--
2.26.3