diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-16 15:20:05 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-16 15:20:05 -0600 |
commit | 47f4dac3fde809e3da4e60d9eb699f1d4b378249 (patch) | |
tree | 0b466b044d1ef9180cdf7ae50ccf730b2e6f8dbb /hmp.c | |
parent | af381ebeacdefcec0d2b44bdbb9d6e01e35f691f (diff) | |
parent | 0a1a7fabda7f0fa05ef09051be29e92e81f929ad (diff) |
Merge remote-tracking branch 'kraxel/chardev.1' into staging
# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/chardev.1:
chardev: add pty chardev support to chardev-add (qmp)
chardev: add socket chardev support to chardev-add (qmp)
chardev: add parallel chardev support to chardev-add (qmp)
chardev: add serial chardev support to chardev-add (qmp)
chardev: add file chardev support to chardev-add (qmp)
chardev: add hmp hotplug commands
chardev: add qmp hotplug commands, with null chardev support
chardev: reduce chardev ifdef mess a bit
chardev: fix QemuOpts lifecycle
chardev: add error reporting for qemu_chr_new_from_opts
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1336,3 +1336,26 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict) qmp_nbd_server_stop(&errp); hmp_handle_error(mon, &errp); } + +void hmp_chardev_add(Monitor *mon, const QDict *qdict) +{ + const char *args = qdict_get_str(qdict, "args"); + Error *err = NULL; + QemuOpts *opts; + + opts = qemu_opts_parse(qemu_find_opts("chardev"), args, 1); + if (opts == NULL) { + error_setg(&err, "Parsing chardev args failed\n"); + } else { + qemu_chr_new_from_opts(opts, NULL, &err); + } + hmp_handle_error(mon, &err); +} + +void hmp_chardev_remove(Monitor *mon, const QDict *qdict) +{ + Error *local_err = NULL; + + qmp_chardev_remove(qdict_get_str(qdict, "id"), &local_err); + hmp_handle_error(mon, &local_err); +} |