From: Marc-André Lureau Date: Fri, 16 Jan 2026 07:48:33 +0000 (+0400) Subject: audio/wav: convert to QOM lifecycle methods X-Git-Tag: v11.0.0-rc0~55^2~41 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e70c55fee99e66bf0b84816ca095dc9da71819e3;p=thirdparty%2Fqemu.git audio/wav: convert to QOM lifecycle methods Remove the legacy driver init/fini callbacks from the WAV audio backend. The wav_audio_init() just returned the Audiodev pointer and wav_audio_fini() only logged a debug message. Access to the Audiodev is now through hw->s->dev instead of the drv_opaque pointer. Reviewed-by: Mark Cave-Ayland Reviewed-by: Akihiko Odaki Signed-off-by: Marc-André Lureau --- diff --git a/audio/wavaudio.c b/audio/wavaudio.c index cd2ceffd42b..f1a414f208c 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -89,7 +89,7 @@ static int wav_init_out(HWVoiceOut *hw, struct audsettings *as, 0x02, 0x00, 0x44, 0xac, 0x00, 0x00, 0x10, 0xb1, 0x02, 0x00, 0x04, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00 }; - Audiodev *dev = drv_opaque; + Audiodev *dev = hw->s->dev; AudiodevWavOptions *wopts = &dev->u.wav; struct audsettings wav_as = audiodev_to_audsettings(dev->u.wav.out); const char *wav_path = wopts->path ?: "qemu.wav"; @@ -200,17 +200,6 @@ static void wav_enable_out(HWVoiceOut *hw, bool enable) } } -static void *wav_audio_init(Audiodev *dev, Error **errp) -{ - assert(dev->driver == AUDIODEV_DRIVER_WAV); - return dev; -} - -static void wav_audio_fini (void *opaque) -{ - ldebug ("wav_fini"); -} - static struct audio_pcm_ops wav_pcm_ops = { .init_out = wav_init_out, .fini_out = wav_fini_out, @@ -222,8 +211,6 @@ static struct audio_pcm_ops wav_pcm_ops = { static struct audio_driver wav_audio_driver = { .name = "wav", - .init = wav_audio_init, - .fini = wav_audio_fini, .pcm_ops = &wav_pcm_ops, .max_voices_out = 1, .max_voices_in = 0,