diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-02-20 12:04:02 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-02-20 12:10:23 +0000 |
commit | 4c0c9bbe78901a706497a8fa1a27935bafc20cf7 (patch) | |
tree | 43fe900e8e748606dcdb0ef22d10068cc4608aaa /qemu-char.c | |
parent | 46eef33b89e936ca793e13c4aeea1414e97e8dbb (diff) | |
parent | 1094fd3a6219923c8d1abfc7dee5af996a181e7a (diff) |
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp:
monitor: Add object_add class argument completion.
monitor: Add object_del id argument completion.
monitor: Add device_add device argument completion.
monitor: Add device_del id argument completion.
qmp: expose list of supported character device backends
Use error_is_set() only when necessary
QMP: allow JSON dict arguments in qmp-shell
hmp: migrate command (without -d) now blocks correctly
Conflicts:
blockdev.c
[PMM: resolved trivial conflict in blockdev.c]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/qemu-char.c b/qemu-char.c index 30c5a6afd0..4d50838b3b 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2725,7 +2725,7 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts) chr = qemu_chr_open_socket_fd(fd, do_nodelay, is_listen, is_telnet, is_waitconnect, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { goto fail; } return chr; @@ -2938,7 +2938,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename) Error *local_err = NULL; opts = qemu_opts_create(qemu_find_opts("chardev"), label, 1, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { qerror_report_err(local_err); error_free(local_err); return NULL; @@ -3323,7 +3323,7 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*in return NULL; chr = qemu_chr_new_from_opts(opts, init, &err); - if (error_is_set(&err)) { + if (err) { error_report("%s", error_get_pretty(err)); error_free(err); } @@ -3432,6 +3432,25 @@ ChardevInfoList *qmp_query_chardev(Error **errp) return chr_list; } +ChardevBackendInfoList *qmp_query_chardev_backends(Error **errp) +{ + ChardevBackendInfoList *backend_list = NULL; + CharDriver *c = NULL; + GSList *i = NULL; + + for (i = backends; i; i = i->next) { + ChardevBackendInfoList *info = g_malloc0(sizeof(*info)); + c = i->data; + info->value = g_malloc0(sizeof(*info->value)); + info->value->name = g_strdup(c->name); + + info->next = backend_list; + backend_list = info; + } + + return backend_list; +} + CharDriverState *qemu_chr_find(const char *name) { CharDriverState *chr; |