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:
parent
f991647ed4
commit
6334967f6c
2 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
void audio_cleanup(void)
|
||||||
{
|
{
|
||||||
default_audio_state = NULL;
|
default_audio_state = NULL;
|
||||||
|
|
@ -1742,6 +1747,9 @@ static AudioState *audio_init(Audiodev *dev, Error **errp)
|
||||||
struct audio_driver *driver;
|
struct audio_driver *driver;
|
||||||
|
|
||||||
s = AUDIO_STATE(object_new(TYPE_AUDIO_STATE));
|
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) {
|
if (!atexit_registered) {
|
||||||
atexit(audio_cleanup);
|
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[] = {
|
static const char *const root_containers[] = {
|
||||||
|
"audiodevs",
|
||||||
"chardevs",
|
"chardevs",
|
||||||
"objects",
|
"objects",
|
||||||
"backend"
|
"backend"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue