mirror of https://gitee.com/openkylin/qemu.git
chardev: report a simpler error about duplicated id
Report: "Chardev with id 'char2' already exists" Rather than: "Failed to add chardev 'char2': duplicate yank instance" Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
64195b0d36
commit
a68403b0a6
|
@ -1036,6 +1036,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
|
|||
ChardevReturn *ret;
|
||||
g_autoptr(Chardev) chr = NULL;
|
||||
|
||||
if (qemu_chr_find(id)) {
|
||||
error_setg(errp, "Chardev with id '%s' already exists", id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cc = char_get_class(ChardevBackendKind_str(backend->type), errp);
|
||||
if (!cc) {
|
||||
goto err;
|
||||
|
|
Loading…
Reference in New Issue