WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] - make qemu serial summagraphics settings a bit more

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] - make qemu serial summagraphics settings a bit more fluid
From: Ben Thomas <bthomas@xxxxxxxxxxxxxxx>
Date: Thu, 18 May 2006 14:50:27 -0400
Delivery-date: Thu, 18 May 2006 11:52:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)
Changeset 9967 made the qemu serial line Summagraphics support a little
more flexible with respect to the COM line chosen.  This patch
furthers that effort by removing the COM2 restriction.  This patch
allows a "-summa n" command line option to qemu to specify which, if
any, COM port should be using the Summagraphics protocols.

Signed-off-by: Ben Thomas (ben@xxxxxxxxxxxxxxx)

--
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@xxxxxxxxxxxxxxx                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                   Lowell, MA 01851
diff -r 48c0f5489d44 tools/ioemu/hw/pc.c
--- a/tools/ioemu/hw/pc.c       Thu May 18 11:39:03 2006 +0100
+++ b/tools/ioemu/hw/pc.c       Thu May 18 14:46:20 2006 -0400
@@ -537,7 +537,7 @@ void pc_init(uint64_t ram_size, int vga_
     for(i = 0; i < MAX_SERIAL_PORTS; i++) {
         if (serial_hds[i]) {
             sp = serial_init(serial_io[i], serial_irq[i], serial_hds[i]);
-            if (i == SUMMA_PORT)
+            if (serial_summa[i])
                summa_init(sp, serial_hds[i]);
         }
     }
diff -r 48c0f5489d44 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Thu May 18 11:39:03 2006 +0100
+++ b/tools/ioemu/vl.c  Thu May 18 14:46:20 2006 -0400
@@ -146,6 +146,7 @@ int repeat_key = 1;
 int repeat_key = 1;
 TextConsole *vga_console;
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+int serial_summa[MAX_SERIAL_PORTS];
 int xc_handle;
 time_t timeoffset = 0;
 
@@ -2244,6 +2245,7 @@ void help(void)
            "Debug/Expert options:\n"
            "-monitor dev    redirect the monitor to char device 'dev'\n"
            "-serial dev     redirect the serial port to char device 'dev'\n"
+          "-summa n        set serial line COMn to be a Summagraphics tablet"
            "-S              freeze CPU at startup (use 'c' to start 
execution)\n"
            "-s              wait gdb connection to port %d\n"
            "-p port         ioreq port for xen\n"
@@ -2349,6 +2351,7 @@ enum {
     QEMU_OPTION_monitor,
     QEMU_OPTION_domainname,
     QEMU_OPTION_serial,
+    QEMU_OPTION_summa,
     QEMU_OPTION_timeoffset,
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
@@ -2425,6 +2428,7 @@ const QEMUOption qemu_options[] = {
     { "domain-name", 1, QEMU_OPTION_domainname },
     { "timeoffset", HAS_ARG, QEMU_OPTION_timeoffset },
     { "serial", 1, QEMU_OPTION_serial },
+    { "summa", 1, QEMU_OPTION_summa },
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "full-screen", 0, QEMU_OPTION_full_screen },
 
@@ -2554,6 +2558,7 @@ int main(int argc, char **argv)
     char monitor_device[128];
     char serial_devices[MAX_SERIAL_PORTS][128];
     int serial_device_index;
+    int summa_index;
     char qemu_dm_logfilename[64];
     const char *loadvm = NULL;
     unsigned long nr_pages, *page_array;
@@ -2588,9 +2593,11 @@ int main(int argc, char **argv)
     pstrcpy(monitor_device, sizeof(monitor_device), "vc");
 
     pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
-    pstrcpy(serial_devices[1], sizeof(serial_devices[1]), "null");
-    for(i = 2; i < MAX_SERIAL_PORTS; i++)
+    serial_summa[0] = 0;
+    for(i = 1; i < MAX_SERIAL_PORTS; i++) {
         serial_devices[i][0] = '\0';
+       serial_summa[i] = 0;
+    }
     serial_device_index = 0;
 
     nb_tun_fds = 0;
@@ -2931,6 +2938,15 @@ int main(int argc, char **argv)
                         sizeof(serial_devices[0]), optarg);
                 serial_device_index++;
                 break;
+            case QEMU_OPTION_summa:
+               summa_index = atoi(optarg);
+               if ( (summa_index <= 0) || (summa_index > MAX_SERIAL_PORTS) ) {
+                   fprintf(stderr, "qemu: summa index out of range\n");
+                   exit(1);
+               }
+               serial_summa[i-1] = 1;
+               break;
+
             case QEMU_OPTION_loadvm:
                 loadvm = optarg;
                 break;
diff -r 48c0f5489d44 tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Thu May 18 11:39:03 2006 +0100
+++ b/tools/ioemu/vl.h  Thu May 18 14:46:20 2006 -0400
@@ -238,9 +238,9 @@ void console_select(unsigned int index);
 /* serial ports */
 
 #define MAX_SERIAL_PORTS 4
-#define SUMMA_PORT     1
 
 extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+extern serial_summa[MAX_SERIAL_PORTS];
 
 /* network redirectors support */
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] - make qemu serial summagraphics settings a bit more fluid, Ben Thomas <=