diff options
author | Anthony Liguori <anthony@codemonkey.ws> | 2013-10-09 07:52:11 -0700 |
---|---|---|
committer | Anthony Liguori <anthony@codemonkey.ws> | 2013-10-09 07:52:11 -0700 |
commit | dfe22799751818115ed6d36bedc8a55b2026de3a (patch) | |
tree | efb7a15719138c01ce9fbfcc3a9a2ee6ab136859 | |
parent | ce079abb410d685d48c1285bc6749d9b23c78c5c (diff) | |
parent | ee6ee83de29923483b4905b35f18abf5333f6ea9 (diff) |
Merge remote-tracking branch 'kraxel/chardev.8' into staging
# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/chardev.8:
chardev: handle qmp_chardev_add(KIND_MUX) failure
Message-id: 1380708925-6721-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
-rw-r--r-- | qemu-char.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-char.c b/qemu-char.c index f7f5464b67..2ca34cd710 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -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); |