mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
audio: return Error ** from audio_state_by_name
Remove duplicate error formatting code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f6061733a9
commit
176adafca7
6 changed files with 13 additions and 20 deletions
|
@ -480,24 +480,16 @@ static void set_audiodev(Object *obj, Visitor *v, const char* name,
|
|||
Property *prop = opaque;
|
||||
QEMUSoundCard *card = object_field_prop_ptr(obj, prop);
|
||||
AudioState *state;
|
||||
int err = 0;
|
||||
char *str;
|
||||
g_autofree char *str = NULL;
|
||||
|
||||
if (!visit_type_str(v, name, &str, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
state = audio_state_by_name(str);
|
||||
|
||||
if (!state) {
|
||||
err = -ENOENT;
|
||||
goto out;
|
||||
state = audio_state_by_name(str, errp);
|
||||
if (state) {
|
||||
card->state = state;
|
||||
}
|
||||
card->state = state;
|
||||
|
||||
out:
|
||||
error_set_from_qdev_prop_error(errp, err, obj, name, str);
|
||||
g_free(str);
|
||||
}
|
||||
|
||||
const PropertyInfo qdev_prop_audiodev = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue