From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GJCcu-0001f5-19 for qemu-devel@nongnu.org; Fri, 01 Sep 2006 13:16:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GJCct-0001eK-20 for qemu-devel@nongnu.org; Fri, 01 Sep 2006 13:16:19 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GJCcs-0001eF-U1 for qemu-devel@nongnu.org; Fri, 01 Sep 2006 13:16:18 -0400 Received: from [212.227.126.187] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GJCml-0002st-Sp for qemu-devel@nongnu.org; Fri, 01 Sep 2006 13:26:32 -0400 Received: from localhost ([127.0.0.1]) by localhost.localdomain with esmtp (Exim 4.62) (envelope-from ) id 1GJCco-00012l-KQ for qemu-devel@nongnu.org; Fri, 01 Sep 2006 19:16:14 +0200 Message-ID: <44F86ADD.9000500@weilnetz.de> Date: Fri, 01 Sep 2006 19:16:13 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: [Qemu-devel] [PATCH] Additional serial and parallel device Content-Type: multipart/mixed; boundary="------------060408050509070703000104" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------060408050509070703000104 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Hello, well, the subject line is not exactly true: my patch does not add a new device, but allows to disable a device. "-serial none" disables the default serial device, "-parallel none" disables the default parallel device. It is also possible to skip a device: "-serial none -serial vc" adds serial 1 without serial 0. Many new PC platforms do not provide a serial device - now QEMU can emulate these platforms better :-) Regards Stefan --------------060408050509070703000104 Content-Type: text/plain; name="qemu.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu.patch" Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.210 diff -u -b -B -r1.210 vl.c --- vl.c 19 Aug 2006 12:37:52 -0000 1.210 +++ vl.c 1 Sep 2006 15:13:30 -0000 @@ -6844,27 +6844,29 @@ monitor_init(monitor_hd, !nographic); for(i = 0; i < MAX_SERIAL_PORTS; i++) { - if (serial_devices[i][0] != '\0') { - serial_hds[i] = qemu_chr_open(serial_devices[i]); + const char *devname = serial_devices[i]; + if (devname[0] != '\0' && strcmp(devname, "none")) { + serial_hds[i] = qemu_chr_open(devname); if (!serial_hds[i]) { fprintf(stderr, "qemu: could not open serial device '%s'\n", - serial_devices[i]); + devname); exit(1); } - if (!strcmp(serial_devices[i], "vc")) + if (!strcmp(devname, "vc")) qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i); } } for(i = 0; i < MAX_PARALLEL_PORTS; i++) { - if (parallel_devices[i][0] != '\0') { - parallel_hds[i] = qemu_chr_open(parallel_devices[i]); + const char *devname = parallel_devices[i]; + if (devname[0] != '\0' && strcmp(devname, "none")) { + parallel_hds[i] = qemu_chr_open(devname); if (!parallel_hds[i]) { fprintf(stderr, "qemu: could not open parallel device '%s'\n", - parallel_devices[i]); + devname); exit(1); } - if (!strcmp(parallel_devices[i], "vc")) + if (!strcmp(devname, "vc")) qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i); } } Index: qemu-doc.texi =================================================================== RCS file: /sources/qemu/qemu/qemu-doc.texi,v retrieving revision 1.107 diff -u -b -B -r1.107 qemu-doc.texi --- qemu-doc.texi 21 Aug 2006 20:28:18 -0000 1.107 +++ qemu-doc.texi 1 Sep 2006 15:13:31 -0000 @@ -506,12 +506,16 @@ This option can be used several times to simulate up to 4 serials ports. +Use @code{-serial none} to disable all serial ports. + Available character devices are: @table @code @item vc Virtual console @item pty [Linux only] Pseudo TTY (a new PTY is automatically allocated) +@item none +No device is allocated. @item null void device @item /dev/XXX @@ -593,6 +597,8 @@ This option can be used several times to simulate up to 3 parallel ports. +Use @code{-parallel none} to disable all parallel ports. + @item -monitor dev Redirect the monitor to host device @var{dev} (same devices as the serial port). --------------060408050509070703000104--