Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 26 ++++++++++++++++----------
src/conf/domain_conf.h | 4 ++--
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 313d7fd291..24d124158e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19209,18 +19209,24 @@ virDomainLoaderDefParseXML(xmlNodePtr node,
VIR_FREE(loader->path);
}
- if (readonly_str &&
- (loader->readonly = virTristateBoolTypeFromString(readonly_str)) <= 0) {
- virReportError(VIR_ERR_XML_DETAIL,
- _("unknown readonly value: %s"), readonly_str);
- return -1;
+ if (readonly_str) {
+ int value;
+ if ((value = virTristateBoolTypeFromString(readonly_str)) <= 0) {
+ virReportError(VIR_ERR_XML_DETAIL,
+ _("unknown readonly value: %s"), readonly_str);
+ return -1;
+ }
+ loader->readonly = value;
}
- if (secure_str &&
- (loader->secure = virTristateBoolTypeFromString(secure_str)) <= 0) {
- virReportError(VIR_ERR_XML_DETAIL,
- _("unknown secure value: %s"), secure_str);
- return -1;
+ if (secure_str) {
+ int value;
+ if ((value = virTristateBoolTypeFromString(secure_str)) <= 0) {
+ virReportError(VIR_ERR_XML_DETAIL,
+ _("unknown secure value: %s"), secure_str);
+ return -1;
+ }
+ loader->secure = value;
}
if (type_str) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cdf3e2ed8e..b2e14ba2e1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2153,9 +2153,9 @@ VIR_ENUM_DECL(virDomainLoader);
struct _virDomainLoaderDef {
char *path;
- int readonly; /* enum virTristateBool */
+ virTristateBool readonly;
virDomainLoader type;
- int secure; /* enum virTristateBool */
+ virTristateBool secure;
char *nvram; /* path to non-volatile RAM */
char *templt; /* user override of path to master nvram */
};
--
2.26.2