Revision c9f398e5 vl.c
b/vl.c | ||
---|---|---|
4748 | 4748 |
DEV_SERIAL, /* -serial */ |
4749 | 4749 |
DEV_PARALLEL, /* -parallel */ |
4750 | 4750 |
DEV_VIRTCON, /* -virtioconsole */ |
4751 |
DEV_DEBUGCON, /* -debugcon */ |
|
4751 | 4752 |
} type; |
4752 | 4753 |
const char *cmdline; |
4753 | 4754 |
QTAILQ_ENTRY(device_config) next; |
... | ... | |
4845 | 4846 |
return 0; |
4846 | 4847 |
} |
4847 | 4848 |
|
4849 |
static int debugcon_parse(const char *devname) |
|
4850 |
{ |
|
4851 |
QemuOpts *opts; |
|
4852 |
|
|
4853 |
if (!qemu_chr_open("debugcon", devname, NULL)) { |
|
4854 |
exit(1); |
|
4855 |
} |
|
4856 |
opts = qemu_opts_create(&qemu_device_opts, "debugcon", 1); |
|
4857 |
if (!opts) { |
|
4858 |
fprintf(stderr, "qemu: already have a debugcon device\n"); |
|
4859 |
exit(1); |
|
4860 |
} |
|
4861 |
qemu_opt_set(opts, "driver", "isa-debugcon"); |
|
4862 |
qemu_opt_set(opts, "chardev", "debugcon"); |
|
4863 |
return 0; |
|
4864 |
} |
|
4865 |
|
|
4848 | 4866 |
int main(int argc, char **argv, char **envp) |
4849 | 4867 |
{ |
4850 | 4868 |
const char *gdbstub_dev = NULL; |
... | ... | |
5390 | 5408 |
add_device_config(DEV_PARALLEL, optarg); |
5391 | 5409 |
default_parallel = 0; |
5392 | 5410 |
break; |
5411 |
case QEMU_OPTION_debugcon: |
|
5412 |
add_device_config(DEV_DEBUGCON, optarg); |
|
5413 |
break; |
|
5393 | 5414 |
case QEMU_OPTION_loadvm: |
5394 | 5415 |
loadvm = optarg; |
5395 | 5416 |
break; |
... | ... | |
5927 | 5948 |
exit(1); |
5928 | 5949 |
if (foreach_device_config(DEV_VIRTCON, virtcon_parse) < 0) |
5929 | 5950 |
exit(1); |
5951 |
if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0) |
|
5952 |
exit(1); |
|
5930 | 5953 |
|
5931 | 5954 |
module_call_init(MODULE_INIT_DEVICE); |
5932 | 5955 |
|
Also available in: Unified diff