Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 13 ++++++++-----
src/conf/domain_conf.h | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9d98f487ea..d8e34e79b0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13495,11 +13495,14 @@ virDomainAudioCommonParse(virDomainAudioIOCommon *def,
return -1;
}
- if (format &&
- (def->format = virDomainAudioFormatTypeFromString(format)) <= 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("cannot parse 'format' value
'%s'"), format);
- return -1;
+ if (format) {
+ int value;
+ if ((value = virDomainAudioFormatTypeFromString(format)) <= 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("cannot parse 'format' value
'%s'"), format);
+ return -1;
+ }
+ def->format = value;
}
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 85c318d027..a694b434c6 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1502,7 +1502,7 @@ struct _virDomainAudioIOCommon {
unsigned int frequency;
unsigned int channels;
unsigned int voices;
- int format; /* virDomainAudioFormat */
+ virDomainAudioFormat format;
unsigned int bufferLength; /* milliseconds */
};
--
2.26.3