Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 5 +++--
src/conf/domain_conf.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 86680e0cdb..f55117e849 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8845,13 +8845,14 @@ virDomainDiskDefGeometryParse(virDomainDiskDef *def,
}
if ((tmp = virXMLPropString(cur, "trans"))) {
- def->geometry.trans = virDomainDiskGeometryTransTypeFromString(tmp);
- if (def->geometry.trans <= 0) {
+ int value;
+ if ((value = virDomainDiskGeometryTransTypeFromString(tmp)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("invalid translation value '%s'"),
tmp);
return -1;
}
+ def->geometry.trans = value;
}
return 0;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 41e570765e..cf8481f1f6 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -549,7 +549,7 @@ struct _virDomainDiskDef {
unsigned int cylinders;
unsigned int heads;
unsigned int sectors;
- int trans; /* enum virDomainDiskGeometryTrans */
+ virDomainDiskGeometryTrans trans;
} geometry;
struct {
--
2.26.3