aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-09-22 17:29:19 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-10-03 10:29:39 +0200
commit176adafca72ecc35e7f1f011deb52ca1ae091df6 (patch)
tree6f31af462366329651714f75ea0fd107215b2265 /audio/audio.c
parentf6061733a96314ccb732efe6c91357d66f8970af (diff)
audio: return Error ** from audio_state_by_name
Remove duplicate error formatting code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/audio.c b/audio/audio.c
index fdc34a7752..874a4c3c41 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -2260,7 +2260,7 @@ int audio_buffer_bytes(AudiodevPerDirectionOptions *pdo,
audioformat_bytes_per_sample(as->fmt);
}
-AudioState *audio_state_by_name(const char *name)
+AudioState *audio_state_by_name(const char *name, Error **errp)
{
AudioState *s;
QTAILQ_FOREACH(s, &audio_states, list) {
@@ -2269,6 +2269,7 @@ AudioState *audio_state_by_name(const char *name)
return s;
}
}
+ error_setg(errp, "audiodev '%s' not found", name);
return NULL;
}