On 5/19/21 4:10 PM, Tim Wiederhake wrote:
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 17 +++++++++--------
src/conf/domain_conf.h | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 758f699c2c..9e6719265f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13236,15 +13236,16 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt
G_GNUC_UNUSED,
break;
case VIR_DOMAIN_AUDIO_TYPE_SDL: {
- g_autofree char *driver = virXMLPropString(node, "driver");
- if (driver &&
- (def->backend.sdl.driver =
- virDomainAudioSDLDriverTypeFromString(driver)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown SDL driver '%s'"), driver);
- goto error;
+ g_autofree char *driverstr = virXMLPropString(node, "driver");
+ int driver;
+ if (driverstr) {
+ if ((driver = virDomainAudioSDLDriverTypeFromString(driverstr)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown SDL driver '%s'"), driverstr);
Misaligned argument.
+ goto error;
+ }
+ def->backend.sdl.driver = driver;
}
-
if (inputNode)
virDomainAudioSDLParse(&def->backend.sdl.input, inputNode);
if (outputNode)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 462c61a807..fab856a5c7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1578,7 +1578,7 @@ struct _virDomainAudioDef {
struct {
virDomainAudioIOSDL input;
virDomainAudioIOSDL output;
- int driver; /* virDomainAudioSDLDriver */
+ virDomainAudioSDLDriver driver;
} sdl;
struct {
char *path;
Michal