aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index e881e456b6..2b0b65347b 100644
--- a/vl.c
+++ b/vl.c
@@ -4748,6 +4748,7 @@ struct device_config {
DEV_SERIAL, /* -serial */
DEV_PARALLEL, /* -parallel */
DEV_VIRTCON, /* -virtioconsole */
+ DEV_DEBUGCON, /* -debugcon */
} type;
const char *cmdline;
QTAILQ_ENTRY(device_config) next;
@@ -4845,6 +4846,23 @@ static int virtcon_parse(const char *devname)
return 0;
}
+static int debugcon_parse(const char *devname)
+{
+ QemuOpts *opts;
+
+ if (!qemu_chr_open("debugcon", devname, NULL)) {
+ exit(1);
+ }
+ opts = qemu_opts_create(&qemu_device_opts, "debugcon", 1);
+ if (!opts) {
+ fprintf(stderr, "qemu: already have a debugcon device\n");
+ exit(1);
+ }
+ qemu_opt_set(opts, "driver", "isa-debugcon");
+ qemu_opt_set(opts, "chardev", "debugcon");
+ return 0;
+}
+
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
@@ -5390,6 +5408,9 @@ int main(int argc, char **argv, char **envp)
add_device_config(DEV_PARALLEL, optarg);
default_parallel = 0;
break;
+ case QEMU_OPTION_debugcon:
+ add_device_config(DEV_DEBUGCON, optarg);
+ break;
case QEMU_OPTION_loadvm:
loadvm = optarg;
break;
@@ -5927,6 +5948,8 @@ int main(int argc, char **argv, char **envp)
exit(1);
if (foreach_device_config(DEV_VIRTCON, virtcon_parse) < 0)
exit(1);
+ if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
+ exit(1);
module_call_init(MODULE_INIT_DEVICE);