[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/58] chardev: Add 'help' option to print all availa
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 30/58] chardev: Add 'help' option to print all available chardev backend types |
Date: |
Tue, 13 Sep 2016 19:16:01 +0200 |
From: Lin Ma <address@hidden>
Signed-off-by: Lin Ma <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qemu-char.c | 21 ++++++++++++++++-----
qemu-options.hx | 3 +++
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 5f82ebb..cf6a27a 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -39,6 +39,7 @@
#include "io/channel-file.h"
#include "io/channel-tls.h"
#include "sysemu/replay.h"
+#include "qemu/help_option.h"
#include <zlib.h>
@@ -3879,16 +3880,26 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
const char *id = qemu_opts_id(opts);
char *bid = NULL;
- if (id == NULL) {
- error_setg(errp, "chardev: no id specified");
- goto err;
- }
-
if (qemu_opt_get(opts, "backend") == NULL) {
error_setg(errp, "chardev: \"%s\" missing backend",
qemu_opts_id(opts));
goto err;
}
+
+ if (is_help_option(qemu_opt_get(opts, "backend"))) {
+ fprintf(stderr, "Available chardev backend types:\n");
+ for (i = backends; i; i = i->next) {
+ cd = i->data;
+ fprintf(stderr, "%s\n", cd->name);
+ }
+ exit(!is_help_option(qemu_opt_get(opts, "backend")));
+ }
+
+ if (id == NULL) {
+ error_setg(errp, "chardev: no id specified");
+ goto err;
+ }
+
for (i = backends; i; i = i->next) {
cd = i->data;
diff --git a/qemu-options.hx b/qemu-options.hx
index 5209626..4927939 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2152,6 +2152,7 @@ The general form of a character device option is:
ETEXI
DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
+ "-chardev help\n"
"-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
"-chardev
socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
" [,server][,nowait][,telnet][,reconnect=seconds][,mux=on|off]\n"
@@ -2217,6 +2218,8 @@ Backend is one of:
@option{spiceport}.
The specific backend will determine the applicable options.
+Use "-chardev help" to print all available chardev backend types.
+
All devices must have an id, which can be any string up to 127 characters long.
It is used to uniquely identify this device in other command line directives.
--
1.8.3.1
- [Qemu-devel] [PULL 16/58] cpus: update comments, (continued)
- [Qemu-devel] [PULL 16/58] cpus: update comments, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 19/58] lsi: do not exit QEMU if reading invalid register, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 20/58] lsi: implement I/O memory space for Memory Move instructions, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 17/58] help: Update help to remove misleading display information, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 18/58] lsi: print register names in debug prints, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 22/58] MAINTAINERS: add myself as stubs maintainers, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 25/58] scsi: mptconfig: fix an assert expression, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 26/58] scsi: mptconfig: fix misuse of MPTSAS_CONFIG_PACK, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 27/58] vmxcap: Show raw MSR value, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 28/58] vmxcap: Add TSC scaling bit, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 30/58] chardev: Add 'help' option to print all available chardev backend types,
Paolo Bonzini <=
- [Qemu-devel] [PULL 29/58] doc/rcu: fix typo, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 31/58] MAINTAINERS: Fix wildcard for scsi headers, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 32/58] MAINTAINERS: Add some header files to the PC chipset section, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 35/58] default-configs: removed obsolete CONFIG_ISA_MMIO, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 33/58] scsi: pvscsi: limit loop to fetch SG list, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 34/58] default-configs: remove CONFIG_PAM, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 38/58] sclpconsolelm: remove bogus check for -EAGAIN, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 37/58] ipmi: check return of qemu_chr_fe_write() for errors, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 40/58] char: convert qemu_chr_fe_write to qemu_chr_fe_write_all, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 39/58] hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all, Paolo Bonzini, 2016/09/13