Revision ddd9bbd9
b/vl.c | ||
---|---|---|
173 | 173 |
|
174 | 174 |
#define DEFAULT_RAM_SIZE 128 |
175 | 175 |
|
176 |
/* Maximum number of monitor devices */ |
|
177 |
#define MAX_MONITOR_DEVICES 10 |
|
178 |
|
|
176 | 179 |
static const char *data_dir; |
177 | 180 |
const char *bios_name = NULL; |
178 | 181 |
/* Note: drives_table[MAX_DRIVES] is a dummy block driver if none available |
... | ... | |
4854 | 4857 |
QemuOpts *hda_opts = NULL, *opts; |
4855 | 4858 |
int optind; |
4856 | 4859 |
const char *r, *optarg; |
4857 |
CharDriverState *monitor_hd = NULL; |
|
4858 |
const char *monitor_device; |
|
4860 |
CharDriverState *monitor_hds[MAX_MONITOR_DEVICES]; |
|
4861 |
const char *monitor_devices[MAX_MONITOR_DEVICES]; |
|
4862 |
int monitor_device_index; |
|
4859 | 4863 |
const char *serial_devices[MAX_SERIAL_PORTS]; |
4860 | 4864 |
int serial_device_index; |
4861 | 4865 |
const char *parallel_devices[MAX_PARALLEL_PORTS]; |
... | ... | |
4924 | 4928 |
kernel_cmdline = ""; |
4925 | 4929 |
cyls = heads = secs = 0; |
4926 | 4930 |
translation = BIOS_ATA_TRANSLATION_AUTO; |
4927 |
monitor_device = "vc:80Cx24C"; |
|
4928 | 4931 |
|
4929 | 4932 |
serial_devices[0] = "vc:80Cx24C"; |
4930 | 4933 |
for(i = 1; i < MAX_SERIAL_PORTS; i++) |
... | ... | |
4940 | 4943 |
virtio_consoles[i] = NULL; |
4941 | 4944 |
virtio_console_index = 0; |
4942 | 4945 |
|
4946 |
monitor_devices[0] = "vc:80Cx24C"; |
|
4947 |
for (i = 1; i < MAX_MONITOR_DEVICES; i++) { |
|
4948 |
monitor_devices[i] = NULL; |
|
4949 |
} |
|
4950 |
monitor_device_index = 0; |
|
4951 |
|
|
4943 | 4952 |
for (i = 0; i < MAX_NODES; i++) { |
4944 | 4953 |
node_mem[i] = 0; |
4945 | 4954 |
node_cpumask[i] = 0; |
... | ... | |
5352 | 5361 |
break; |
5353 | 5362 |
} |
5354 | 5363 |
case QEMU_OPTION_monitor: |
5355 |
monitor_device = optarg; |
|
5364 |
if (monitor_device_index >= MAX_MONITOR_DEVICES) { |
|
5365 |
fprintf(stderr, "qemu: too many monitor devices\n"); |
|
5366 |
exit(1); |
|
5367 |
} |
|
5368 |
monitor_devices[monitor_device_index] = optarg; |
|
5369 |
monitor_device_index++; |
|
5356 | 5370 |
break; |
5357 | 5371 |
case QEMU_OPTION_serial: |
5358 | 5372 |
if (serial_device_index >= MAX_SERIAL_PORTS) { |
... | ... | |
5662 | 5676 |
serial_devices[0] = "stdio"; |
5663 | 5677 |
if (parallel_device_index == 0) |
5664 | 5678 |
parallel_devices[0] = "null"; |
5665 |
if (strncmp(monitor_device, "vc", 2) == 0) |
|
5666 |
monitor_device = "stdio"; |
|
5679 |
if (strncmp(monitor_devices[0], "vc", 2) == 0) { |
|
5680 |
monitor_devices[0] = "stdio"; |
|
5681 |
} |
|
5667 | 5682 |
} |
5668 | 5683 |
|
5669 | 5684 |
#ifndef _WIN32 |
... | ... | |
5809 | 5824 |
register_savevm_live("ram", 0, 3, ram_save_live, NULL, ram_load, NULL); |
5810 | 5825 |
|
5811 | 5826 |
/* Maintain compatibility with multiple stdio monitors */ |
5812 |
if (!strcmp(monitor_device,"stdio")) { |
|
5827 |
if (!strcmp(monitor_devices[0],"stdio")) {
|
|
5813 | 5828 |
for (i = 0; i < MAX_SERIAL_PORTS; i++) { |
5814 | 5829 |
const char *devname = serial_devices[i]; |
5815 | 5830 |
if (devname && !strcmp(devname,"mon:stdio")) { |
5816 |
monitor_device = NULL; |
|
5831 |
monitor_devices[0] = NULL;
|
|
5817 | 5832 |
break; |
5818 | 5833 |
} else if (devname && !strcmp(devname,"stdio")) { |
5819 |
monitor_device = NULL; |
|
5834 |
monitor_devices[0] = NULL;
|
|
5820 | 5835 |
serial_devices[i] = "mon:stdio"; |
5821 | 5836 |
break; |
5822 | 5837 |
} |
... | ... | |
5875 | 5890 |
} |
5876 | 5891 |
} |
5877 | 5892 |
|
5878 |
if (monitor_device) { |
|
5879 |
monitor_hd = qemu_chr_open("monitor", monitor_device, NULL); |
|
5880 |
if (!monitor_hd) { |
|
5881 |
fprintf(stderr, "qemu: could not open monitor device '%s'\n", monitor_device); |
|
5882 |
exit(1); |
|
5893 |
for (i = 0; i < MAX_MONITOR_DEVICES; i++) { |
|
5894 |
const char *devname = monitor_devices[i]; |
|
5895 |
if (devname && strcmp(devname, "none")) { |
|
5896 |
char label[32]; |
|
5897 |
if (i == 0) { |
|
5898 |
snprintf(label, sizeof(label), "monitor"); |
|
5899 |
} else { |
|
5900 |
snprintf(label, sizeof(label), "monitor%d", i); |
|
5901 |
} |
|
5902 |
monitor_hds[i] = qemu_chr_open(label, devname, NULL); |
|
5903 |
if (!monitor_hds[i]) { |
|
5904 |
fprintf(stderr, "qemu: could not open monitor device '%s'\n", |
|
5905 |
devname); |
|
5906 |
exit(1); |
|
5907 |
} |
|
5883 | 5908 |
} |
5884 | 5909 |
} |
5885 | 5910 |
|
... | ... | |
6028 | 6053 |
text_consoles_set_display(display_state); |
6029 | 6054 |
qemu_chr_initial_reset(); |
6030 | 6055 |
|
6031 |
if (monitor_device && monitor_hd) |
|
6032 |
monitor_init(monitor_hd, MONITOR_USE_READLINE | MONITOR_IS_DEFAULT); |
|
6056 |
for (i = 0; i < MAX_MONITOR_DEVICES; i++) { |
|
6057 |
if (monitor_devices[i] && monitor_hds[i]) { |
|
6058 |
monitor_init(monitor_hds[i], |
|
6059 |
MONITOR_USE_READLINE | |
|
6060 |
((i == 0) ? MONITOR_IS_DEFAULT : 0)); |
|
6061 |
} |
|
6062 |
} |
|
6033 | 6063 |
|
6034 | 6064 |
for(i = 0; i < MAX_SERIAL_PORTS; i++) { |
6035 | 6065 |
const char *devname = serial_devices[i]; |
Also available in: Unified diff