mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00: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:
@ -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 = {
|
||||
|
Reference in New Issue
Block a user