提交 ee6ee83d 编写于 作者: G Gerd Hoffmann

chardev: handle qmp_chardev_add(KIND_MUX) failure

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 a684f3cf
......@@ -3271,7 +3271,12 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
backend->kind = CHARDEV_BACKEND_KIND_MUX;
backend->mux->chardev = g_strdup(bid);
ret = qmp_chardev_add(id, backend, errp);
assert(!error_is_set(errp));
if (error_is_set(errp)) {
chr = qemu_chr_find(bid);
qemu_chr_delete(chr);
chr = NULL;
goto qapi_out;
}
}
chr = qemu_chr_find(id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册