Commit c03b0f0fd86d0d8883528754b24de49b63935c7f

Authored by bellard
1 parent 6192bc37

allow disabling of serial or parallel devices (Stefan Weil)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2141 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 16 additions and 8 deletions
qemu-doc.texi
@@ -506,12 +506,16 @@ Redirect the virtual serial port to host character device @@ -506,12 +506,16 @@ Redirect the virtual serial port to host character device
506 This option can be used several times to simulate up to 4 serials 506 This option can be used several times to simulate up to 4 serials
507 ports. 507 ports.
508 508
  509 +Use @code{-serial none} to disable all serial ports.
  510 +
509 Available character devices are: 511 Available character devices are:
510 @table @code 512 @table @code
511 @item vc 513 @item vc
512 Virtual console 514 Virtual console
513 @item pty 515 @item pty
514 [Linux only] Pseudo TTY (a new PTY is automatically allocated) 516 [Linux only] Pseudo TTY (a new PTY is automatically allocated)
  517 +@item none
  518 +No device is allocated.
515 @item null 519 @item null
516 void device 520 void device
517 @item /dev/XXX 521 @item /dev/XXX
@@ -593,6 +597,8 @@ parallel port. @@ -593,6 +597,8 @@ parallel port.
593 This option can be used several times to simulate up to 3 parallel 597 This option can be used several times to simulate up to 3 parallel
594 ports. 598 ports.
595 599
  600 +Use @code{-parallel none} to disable all parallel ports.
  601 +
596 @item -monitor dev 602 @item -monitor dev
597 Redirect the monitor to host device @var{dev} (same devices as the 603 Redirect the monitor to host device @var{dev} (same devices as the
598 serial port). 604 serial port).
@@ -6850,27 +6850,29 @@ int main(int argc, char **argv) @@ -6850,27 +6850,29 @@ int main(int argc, char **argv)
6850 monitor_init(monitor_hd, !nographic); 6850 monitor_init(monitor_hd, !nographic);
6851 6851
6852 for(i = 0; i < MAX_SERIAL_PORTS; i++) { 6852 for(i = 0; i < MAX_SERIAL_PORTS; i++) {
6853 - if (serial_devices[i][0] != '\0') {  
6854 - serial_hds[i] = qemu_chr_open(serial_devices[i]); 6853 + const char *devname = serial_devices[i];
  6854 + if (devname[0] != '\0' && strcmp(devname, "none")) {
  6855 + serial_hds[i] = qemu_chr_open(devname);
6855 if (!serial_hds[i]) { 6856 if (!serial_hds[i]) {
6856 fprintf(stderr, "qemu: could not open serial device '%s'\n", 6857 fprintf(stderr, "qemu: could not open serial device '%s'\n",
6857 - serial_devices[i]); 6858 + devname);
6858 exit(1); 6859 exit(1);
6859 } 6860 }
6860 - if (!strcmp(serial_devices[i], "vc")) 6861 + if (!strcmp(devname, "vc"))
6861 qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i); 6862 qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i);
6862 } 6863 }
6863 } 6864 }
6864 6865
6865 for(i = 0; i < MAX_PARALLEL_PORTS; i++) { 6866 for(i = 0; i < MAX_PARALLEL_PORTS; i++) {
6866 - if (parallel_devices[i][0] != '\0') {  
6867 - parallel_hds[i] = qemu_chr_open(parallel_devices[i]); 6867 + const char *devname = parallel_devices[i];
  6868 + if (devname[0] != '\0' && strcmp(devname, "none")) {
  6869 + parallel_hds[i] = qemu_chr_open(devname);
6868 if (!parallel_hds[i]) { 6870 if (!parallel_hds[i]) {
6869 fprintf(stderr, "qemu: could not open parallel device '%s'\n", 6871 fprintf(stderr, "qemu: could not open parallel device '%s'\n",
6870 - parallel_devices[i]); 6872 + devname);
6871 exit(1); 6873 exit(1);
6872 } 6874 }
6873 - if (!strcmp(parallel_devices[i], "vc")) 6875 + if (!strcmp(devname, "vc"))
6874 qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i); 6876 qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i);
6875 } 6877 }
6876 } 6878 }