aboutsummaryrefslogtreecommitdiff
path: root/ui
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 /ui
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 'ui')
-rw-r--r--ui/dbus.c3
-rw-r--r--ui/vnc.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/ui/dbus.c b/ui/dbus.c
index 32f1bbe81a..866467ad2e 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -220,9 +220,8 @@ dbus_display_complete(UserCreatable *uc, Error **errp)
}
if (dd->audiodev && *dd->audiodev) {
- AudioState *audio_state = audio_state_by_name(dd->audiodev);
+ AudioState *audio_state = audio_state_by_name(dd->audiodev, errp);
if (!audio_state) {
- error_setg(errp, "Audiodev '%s' not found", dd->audiodev);
return;
}
if (!g_str_equal(audio_state->drv->name, "dbus")) {
diff --git a/ui/vnc.c b/ui/vnc.c
index acb56461b2..8292946913 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -4181,9 +4181,8 @@ void vnc_display_open(const char *id, Error **errp)
audiodev = qemu_opt_get(opts, "audiodev");
if (audiodev) {
- vd->audio_state = audio_state_by_name(audiodev);
+ vd->audio_state = audio_state_by_name(audiodev, errp);
if (!vd->audio_state) {
- error_setg(errp, "Audiodev '%s' not found", audiodev);
goto fail;
}
}