mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
audio: register backends in /audiodevs container
QOM tree now has /audiodevs objects. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
@@ -1676,6 +1676,11 @@ static void audio_state_finalize(Object *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static Object *get_audiodevs_root(void)
|
||||
{
|
||||
return object_get_container("audiodevs");
|
||||
}
|
||||
|
||||
void audio_cleanup(void)
|
||||
{
|
||||
default_audio_state = NULL;
|
||||
@@ -1742,6 +1747,9 @@ static AudioState *audio_init(Audiodev *dev, Error **errp)
|
||||
struct audio_driver *driver;
|
||||
|
||||
s = AUDIO_STATE(object_new(TYPE_AUDIO_STATE));
|
||||
if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJECT(s), errp)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!atexit_registered) {
|
||||
atexit(audio_cleanup);
|
||||
|
||||
@@ -1730,6 +1730,7 @@ const char *object_property_get_type(Object *obj, const char *name, Error **errp
|
||||
}
|
||||
|
||||
static const char *const root_containers[] = {
|
||||
"audiodevs",
|
||||
"chardevs",
|
||||
"objects",
|
||||
"backend"
|
||||
|
||||
Reference in New Issue
Block a user