ia64/xen-unstable

changeset 15073:07b1e917c9d8

[qemu patches] Update patches upto changeset 15032:8f510bf078c7.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Thu May 10 16:22:27 2007 +0100 (2007-05-10)
parents 31a3f83d1610
children 23c4790512db
files tools/ioemu/patches/qemu-infrastructure tools/ioemu/patches/vnc-access-monitor-vt tools/ioemu/patches/vnc-fix-text-display-shift-key tools/ioemu/patches/vnc-listen-specific-interface
line diff
     1.1 --- a/tools/ioemu/patches/qemu-infrastructure	Thu May 10 16:05:31 2007 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,28 +0,0 @@
     1.4 -Index: ioemu/cpu-all.h
     1.5 -===================================================================
     1.6 ---- ioemu.orig/cpu-all.h	2007-05-03 19:00:05.000000000 +0100
     1.7 -+++ ioemu/cpu-all.h	2007-05-03 19:00:55.000000000 +0100
     1.8 -@@ -828,6 +828,23 @@
     1.9 - int cpu_inl(CPUState *env, int addr);
    1.10 - #endif
    1.11 - 
    1.12 -+#if defined(__i386__) || defined(__x86_64__)
    1.13 -+static __inline__ void atomic_set_bit(long nr, volatile void *addr)
    1.14 -+{
    1.15 -+        __asm__ __volatile__(
    1.16 -+                "lock ; bts %1,%0"
    1.17 -+                :"=m" (*(volatile long *)addr)
    1.18 -+                :"dIr" (nr));
    1.19 -+}
    1.20 -+static __inline__ void atomic_clear_bit(long nr, volatile void *addr)
    1.21 -+{
    1.22 -+        __asm__ __volatile__(
    1.23 -+                "lock ; btr %1,%0"
    1.24 -+                :"=m" (*(volatile long *)addr)
    1.25 -+                :"dIr" (nr));
    1.26 -+}
    1.27 -+#endif
    1.28 -+
    1.29 - /* memory API */
    1.30 - 
    1.31 - extern uint64_t phys_ram_size;
     2.1 --- a/tools/ioemu/patches/vnc-access-monitor-vt	Thu May 10 16:05:31 2007 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,15 +0,0 @@
     2.4 -Index: ioemu/vnc.c
     2.5 -===================================================================
     2.6 ---- ioemu.orig/vnc.c	2007-05-03 19:50:17.000000000 +0100
     2.7 -+++ ioemu/vnc.c	2007-05-03 19:54:29.000000000 +0100
     2.8 -@@ -33,6 +33,10 @@
     2.9 - #include "vnc_keysym.h"
    2.10 - #include "keymaps.c"
    2.11 - 
    2.12 -+#define XK_MISCELLANY
    2.13 -+#define XK_LATIN1
    2.14 -+#include <X11/keysymdef.h>
    2.15 -+
    2.16 - typedef struct Buffer
    2.17 - {
    2.18 -     size_t capacity;
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/ioemu/patches/vnc-fix-text-display-shift-key	Thu May 10 16:22:27 2007 +0100
     3.3 @@ -0,0 +1,13 @@
     3.4 +Index: ioemu/vnc.c
     3.5 +===================================================================
     3.6 +--- ioemu.orig/vnc.c	2007-05-10 15:11:44.000000000 +0100
     3.7 ++++ ioemu/vnc.c	2007-05-10 15:11:44.000000000 +0100
     3.8 +@@ -993,7 +993,7 @@
     3.9 + 
    3.10 + static void key_event(VncState *vs, int down, uint32_t sym)
    3.11 + {
    3.12 +-    if (sym >= 'A' && sym <= 'Z')
    3.13 ++    if (sym >= 'A' && sym <= 'Z' && is_graphic_console())
    3.14 + 	sym = sym - 'A' + 'a';
    3.15 +     do_key_event(vs, down, sym);
    3.16 + }
     4.1 --- a/tools/ioemu/patches/vnc-listen-specific-interface	Thu May 10 16:05:31 2007 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,208 +0,0 @@
     4.4 -# HG changeset patch
     4.5 -# User Christian Limpach <Christian.Limpach@xensource.com>
     4.6 -# Node ID a95dfbc8dca8ecddcb9be51d78f446b0fa461892
     4.7 -# Parent  8959876abbe319963974fab21dda7185e0ad84e6
     4.8 -[HVM/vncserver] Implement a 'vnclisten' option to limit the interface
     4.9 -that the VNC server from qemu listens on. 
    4.10 -
    4.11 -Defaults to only listen on 127.0.0.1
    4.12 -
    4.13 -The old behaviour (listen on all interfaces) can be restored, by
    4.14 -- changing the system-wide default in /etc/xen/xend-config.sxp by adding:
    4.15 -(vnc-listen '0.0.0.0')
    4.16 -- changing individual domain config files by adding:
    4.17 -vnclisten="0.0.0.0"
    4.18 -
    4.19 -Also allows specifying the hostname associated with an interface to limit
    4.20 -to that interface.
    4.21 -
    4.22 -Signed-off-by:  Daniel P. Berrange <berrange@redhat.com>
    4.23 -
    4.24 -Index: ioemu/vl.c
    4.25 -===================================================================
    4.26 ---- ioemu.orig/vl.c	2007-05-09 14:12:16.000000000 +0100
    4.27 -+++ ioemu/vl.c	2007-05-09 14:12:43.000000000 +0100
    4.28 -@@ -133,6 +133,7 @@
    4.29 - int nographic;
    4.30 - int vncviewer;
    4.31 - int vncunused;
    4.32 -+struct sockaddr_in vnclisten_addr;
    4.33 - const char* keyboard_layout = NULL;
    4.34 - int64_t ticks_per_sec;
    4.35 - int boot_device = 'c';
    4.36 -@@ -3008,10 +3009,22 @@
    4.37 -     return -1;
    4.38 - }
    4.39 - 
    4.40 -+int parse_host(struct sockaddr_in *saddr, const char *buf)
    4.41 -+{
    4.42 -+    struct hostent *he;
    4.43 -+
    4.44 -+    if ((he = gethostbyname(buf)) != NULL) {
    4.45 -+        saddr->sin_addr = *(struct in_addr *)he->h_addr;
    4.46 -+    } else {
    4.47 -+        if (!inet_aton(buf, &saddr->sin_addr))
    4.48 -+            return -1;
    4.49 -+    }
    4.50 -+    return 0;
    4.51 -+}
    4.52 -+
    4.53 - int parse_host_port(struct sockaddr_in *saddr, const char *str)
    4.54 - {
    4.55 -     char buf[512];
    4.56 --    struct hostent *he;
    4.57 -     const char *p, *r;
    4.58 -     int port;
    4.59 - 
    4.60 -@@ -3022,14 +3035,8 @@
    4.61 -     if (buf[0] == '\0') {
    4.62 -         saddr->sin_addr.s_addr = 0;
    4.63 -     } else {
    4.64 --        if (isdigit(buf[0])) {
    4.65 --            if (!inet_aton(buf, &saddr->sin_addr))
    4.66 --                return -1;
    4.67 --        } else {
    4.68 --            if ((he = gethostbyname(buf)) == NULL)
    4.69 --                return - 1;
    4.70 --            saddr->sin_addr = *(struct in_addr *)he->h_addr;
    4.71 --        }
    4.72 -+        if (parse_host(saddr, buf) == -1)
    4.73 -+            return -1;
    4.74 -     }
    4.75 -     port = strtol(p, (char **)&r, 0);
    4.76 -     if (r == p)
    4.77 -@@ -6313,6 +6320,7 @@
    4.78 - 	   "-vnc display    start a VNC server on display\n"
    4.79 -            "-vncviewer      start a vncviewer process for this domain\n"
    4.80 -            "-vncunused      bind the VNC server to an unused port\n"
    4.81 -+           "-vnclisten      bind the VNC server to this address\n"
    4.82 - #ifndef _WIN32
    4.83 - 	   "-daemonize      daemonize QEMU after initializing\n"
    4.84 - #endif
    4.85 -@@ -6410,6 +6418,7 @@
    4.86 -     QEMU_OPTION_acpi,
    4.87 -     QEMU_OPTION_vncviewer,
    4.88 -     QEMU_OPTION_vncunused,
    4.89 -+    QEMU_OPTION_vnclisten,
    4.90 - };
    4.91 - 
    4.92 - typedef struct QEMUOption {
    4.93 -@@ -6490,6 +6499,7 @@
    4.94 -     { "vnc", HAS_ARG, QEMU_OPTION_vnc },
    4.95 -     { "vncviewer", 0, QEMU_OPTION_vncviewer },
    4.96 -     { "vncunused", 0, QEMU_OPTION_vncunused },
    4.97 -+    { "vnclisten", HAS_ARG, QEMU_OPTION_vnclisten },
    4.98 - 
    4.99 -     /* temporary options */
   4.100 -     { "usb", 0, QEMU_OPTION_usb },
   4.101 -@@ -6889,6 +6899,8 @@
   4.102 - 
   4.103 -     nb_nics = 0;
   4.104 -     /* default mac address of the first network interface */
   4.105 -+
   4.106 -+    memset(&vnclisten_addr.sin_addr, 0, sizeof(vnclisten_addr.sin_addr));
   4.107 -     
   4.108 -     /* init debug */
   4.109 -     sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%ld.log", (long)getpid());
   4.110 -@@ -7280,6 +7292,9 @@
   4.111 -             case QEMU_OPTION_vncunused:
   4.112 -                 vncunused++;
   4.113 -                 break;
   4.114 -+            case QEMU_OPTION_vnclisten:
   4.115 -+                parse_host(&vnclisten_addr, optarg);
   4.116 -+                break;
   4.117 -             }
   4.118 -         }
   4.119 -     }
   4.120 -@@ -7563,7 +7578,8 @@
   4.121 -         dumb_display_init(ds);
   4.122 -     } else if (vnc_display != NULL || vncunused != 0) {
   4.123 - 	int vnc_display_port;
   4.124 --	vnc_display_port = vnc_display_init(ds, vnc_display, vncunused);
   4.125 -+	vnc_display_port = vnc_display_init(ds, vnc_display, vncunused,
   4.126 -+					    &vnclisten_addr);
   4.127 - 	if (vncviewer)
   4.128 - 	    vnc_start_viewer(vnc_display_port);
   4.129 -     } else {
   4.130 -Index: ioemu/vl.h
   4.131 -===================================================================
   4.132 ---- ioemu.orig/vl.h	2007-05-09 14:12:16.000000000 +0100
   4.133 -+++ ioemu/vl.h	2007-05-09 14:12:43.000000000 +0100
   4.134 -@@ -37,6 +37,8 @@
   4.135 - #include <unistd.h>
   4.136 - #include <fcntl.h>
   4.137 - #include <sys/stat.h>
   4.138 -+#include <sys/socket.h>
   4.139 -+#include <sys/types.h>
   4.140 - #include "xenctrl.h"
   4.141 - #include "xs.h"
   4.142 - #include <xen/hvm/e820.h>
   4.143 -@@ -928,7 +930,7 @@
   4.144 - void cocoa_display_init(DisplayState *ds, int full_screen);
   4.145 - 
   4.146 - /* vnc.c */
   4.147 --int vnc_display_init(DisplayState *ds, const char *display, int find_unused);
   4.148 -+int vnc_display_init(DisplayState *ds, const char *display, int find_unused, struct sockaddr_in *iaddr);
   4.149 - void do_info_vnc(void);
   4.150 - int vnc_start_viewer(int port);
   4.151 - 
   4.152 -Index: ioemu/vnc.c
   4.153 -===================================================================
   4.154 ---- ioemu.orig/vnc.c	2007-05-09 14:12:21.000000000 +0100
   4.155 -+++ ioemu/vnc.c	2007-05-09 14:12:43.000000000 +0100
   4.156 -@@ -1270,10 +1270,9 @@
   4.157 - 
   4.158 - extern int parse_host_port(struct sockaddr_in *saddr, const char *str);
   4.159 - 
   4.160 --int vnc_display_init(DisplayState *ds, const char *arg, int find_unused)
   4.161 -+int vnc_display_init(DisplayState *ds, const char *arg, int find_unused, struct sockaddr_in *iaddr)
   4.162 - {
   4.163 -     struct sockaddr *addr;
   4.164 --    struct sockaddr_in iaddr;
   4.165 - #ifndef _WIN32
   4.166 -     struct sockaddr_un uaddr;
   4.167 - #endif
   4.168 -@@ -1334,8 +1333,8 @@
   4.169 -     } else
   4.170 - #endif
   4.171 -     {
   4.172 --	addr = (struct sockaddr *)&iaddr;
   4.173 --	addrlen = sizeof(iaddr);
   4.174 -+	addr = (struct sockaddr *)iaddr;
   4.175 -+	addrlen = sizeof(*iaddr);
   4.176 - 
   4.177 - 	vs->lsock = socket(PF_INET, SOCK_STREAM, 0);
   4.178 - 	if (vs->lsock == -1) {
   4.179 -@@ -1343,12 +1342,12 @@
   4.180 - 	    exit(1);
   4.181 - 	}
   4.182 - 
   4.183 --	if (parse_host_port(&iaddr, arg) < 0) {
   4.184 -+	if (parse_host_port(iaddr, arg) < 0) {
   4.185 - 	    fprintf(stderr, "Could not parse VNC address\n");
   4.186 - 	    exit(1);
   4.187 - 	}
   4.188 - 	    
   4.189 --	iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 5900);
   4.190 -+	iaddr->sin_port = htons(ntohs(iaddr->sin_port) + 5900);
   4.191 - 
   4.192 - 	reuse_addr = 1;
   4.193 - 	ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR,
   4.194 -@@ -1361,7 +1360,7 @@
   4.195 - 
   4.196 -     while (bind(vs->lsock, addr, addrlen) == -1) {
   4.197 - 	if (find_unused && errno == EADDRINUSE) {
   4.198 --	    iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 1);
   4.199 -+	    iaddr->sin_port = htons(ntohs(iaddr->sin_port) + 1);
   4.200 - 	    continue;
   4.201 - 	}
   4.202 - 	fprintf(stderr, "bind() failed\n");
   4.203 -@@ -1378,7 +1377,7 @@
   4.204 - 	exit(1);
   4.205 -     }
   4.206 - 
   4.207 --    return ntohs(iaddr.sin_port);
   4.208 -+    return ntohs(iaddr->sin_port);
   4.209 - }
   4.210 - 
   4.211 - int vnc_start_viewer(int port)