rpms/xen/devel xen-qemu-vnc-authentication.patch, 1.3, 1.3.2.1 xen-qemu-vnc-revert-password.patch, 1.1, 1.1.2.1 xen-qemu-vnc-x509-certs.patch, 1.1, 1.1.2.1 xen.spec, 1.194.2.4, 1.194.2.5

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Mon Oct 29 20:35:53 UTC 2007


Author: berrange

Update of /cvs/pkgs/rpms/xen/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16747

Modified Files:
      Tag: private-berrange-xen-unstable
	xen-qemu-vnc-authentication.patch 
	xen-qemu-vnc-revert-password.patch 
	xen-qemu-vnc-x509-certs.patch xen.spec 
Log Message:
Re-diff & enable VNC auth paches

xen-qemu-vnc-authentication.patch:

Index: xen-qemu-vnc-authentication.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen-qemu-vnc-authentication.patch,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- xen-qemu-vnc-authentication.patch	11 Oct 2007 00:47:59 -0000	1.3
+++ xen-qemu-vnc-authentication.patch	29 Oct 2007 20:35:49 -0000	1.3.2.1
@@ -1,7 +1,7 @@
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/configure xen-3.1.0-src.new/tools/ioemu/configure
---- xen-3.1.0-src.orig/tools/ioemu/configure	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/configure	2007-10-10 17:31:52.000000000 -0400
-@@ -85,6 +85,7 @@ alsa="no"
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/configure xen-unstable.hg-16125.new/tools/ioemu/configure
+--- xen-unstable.hg-16125.orig/tools/ioemu/configure	2007-10-19 09:51:31.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/configure	2007-10-29 15:45:02.000000000 -0400
+@@ -87,6 +87,7 @@ alsa="no"
  fmod="no"
  fmod_lib=""
  fmod_inc=""
@@ -9,7 +9,7 @@
  bsd="no"
  linux="no"
  kqemu="no"
-@@ -214,6 +215,8 @@ for opt do
+@@ -225,6 +226,8 @@ for opt do
    ;;
    --fmod-inc=*) fmod_inc="$optarg"
    ;;
@@ -18,15 +18,15 @@
    --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no"
    ;;
    --disable-slirp) slirp="no"
-@@ -283,6 +286,7 @@ echo "  --enable-coreaudio       enable 
+@@ -292,6 +295,7 @@ echo "  --enable-coreaudio       enable 
  echo "  --enable-alsa            enable ALSA audio driver"
  echo "  --enable-fmod            enable FMOD audio driver"
  echo "  --enabled-dsound         enable DirectSound audio driver"
 +echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
  echo "  --enable-system          enable all system emulation targets"
  echo "  --disable-system         disable all system emulation targets"
- echo "  --enable-user            enable all linux usermode emulation targets"
-@@ -361,6 +365,18 @@ if test "$solaris" = "yes" ; then
+ echo "  --enable-linux-user      enable all linux usermode emulation targets"
+@@ -410,6 +414,18 @@ if test "$solaris" = "yes" ; then
    fi
  fi 
  
@@ -45,7 +45,7 @@
  
  if test -z "$target_list" ; then
  # these targets are portable
-@@ -707,6 +723,12 @@ if test "$fmod" = "yes" ; then
+@@ -772,6 +788,12 @@ if test "$fmod" = "yes" ; then
    echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
    echo "#define CONFIG_FMOD 1" >> $config_h
  fi
@@ -58,7 +58,7 @@
  qemu_version=`head $source_path/VERSION`
  echo "VERSION=$qemu_version" >>$config_mak
  echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
-@@ -914,4 +936,10 @@ if test "$source_path_used" = "yes" ; th
+@@ -999,4 +1021,10 @@ if test "$source_path_used" = "yes" ; th
      done
  fi
  
@@ -69,9 +69,9 @@
 +fi
 +
  rm -f $TMPO $TMPC $TMPE $TMPS
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/d3des.c xen-3.1.0-src.new/tools/ioemu/d3des.c
---- xen-3.1.0-src.orig/tools/ioemu/d3des.c	1969-12-31 19:00:00.000000000 -0500
-+++ xen-3.1.0-src.new/tools/ioemu/d3des.c	2007-10-10 17:31:52.000000000 -0400
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/d3des.c xen-unstable.hg-16125.new/tools/ioemu/d3des.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/d3des.c	1969-12-31 19:00:00.000000000 -0500
++++ xen-unstable.hg-16125.new/tools/ioemu/d3des.c	2007-10-29 15:45:02.000000000 -0400
 @@ -0,0 +1,434 @@
 +/*
 + * This is D3DES (V5.09) by Richard Outerbridge with the double and
@@ -507,9 +507,9 @@
 + *
 + * d3des V5.0a rwo 9208.07 18:44 Graven Imagery
 + **********************************************************************/
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/d3des.h xen-3.1.0-src.new/tools/ioemu/d3des.h
---- xen-3.1.0-src.orig/tools/ioemu/d3des.h	1969-12-31 19:00:00.000000000 -0500
-+++ xen-3.1.0-src.new/tools/ioemu/d3des.h	2007-10-10 17:31:52.000000000 -0400
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/d3des.h xen-unstable.hg-16125.new/tools/ioemu/d3des.h
+--- xen-unstable.hg-16125.orig/tools/ioemu/d3des.h	1969-12-31 19:00:00.000000000 -0500
++++ xen-unstable.hg-16125.new/tools/ioemu/d3des.h	2007-10-29 15:45:02.000000000 -0400
 @@ -0,0 +1,51 @@
 +/*
 + * This is D3DES (V5.09) by Richard Outerbridge with the double and
@@ -562,10 +562,10 @@
 +
 +/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
 + ********************************************************************/
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tools/ioemu/Makefile.target
---- xen-3.1.0-src.orig/tools/ioemu/Makefile.target	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/Makefile.target	2007-10-10 17:31:52.000000000 -0400
-@@ -347,6 +347,11 @@ SOUND_HW += fmopl.o adlib.o
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/Makefile.target xen-unstable.hg-16125.new/tools/ioemu/Makefile.target
+--- xen-unstable.hg-16125.orig/tools/ioemu/Makefile.target	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/Makefile.target	2007-10-29 15:46:53.000000000 -0400
+@@ -387,6 +387,11 @@ SOUND_HW += fmopl.o adlib.o
  endif
  AUDIODRV+= wavcapture.o
  
@@ -577,28 +577,28 @@
  # SCSI layer
  VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
  
-@@ -410,7 +415,7 @@ endif
+@@ -456,7 +461,7 @@ endif
  ifdef CONFIG_SDL
- VL_OBJS+=sdl.o
+ VL_OBJS+=sdl.o x_keymap.o
  endif
 -VL_OBJS+=vnc.o
 +VL_OBJS+=vnc.o d3des.o
  ifdef CONFIG_COCOA
  VL_OBJS+=cocoa.o
  COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
-@@ -468,7 +473,7 @@ cocoa.o: cocoa.m
+@@ -514,7 +519,7 @@ cocoa.o: cocoa.m
  sdl.o: sdl.c keymaps.c sdl_keysym.h
- 	$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
  
 -vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
 +vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
- 	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
  
  sdlaudio.o: sdlaudio.c
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/monitor.c xen-3.1.0-src.new/tools/ioemu/monitor.c
---- xen-3.1.0-src.orig/tools/ioemu/monitor.c	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/monitor.c	2007-10-10 17:31:52.000000000 -0400
-@@ -343,7 +343,7 @@ void do_eject(int force, const char *fil
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/monitor.c xen-unstable.hg-16125.new/tools/ioemu/monitor.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/monitor.c	2007-10-19 09:51:31.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/monitor.c	2007-10-29 15:45:02.000000000 -0400
+@@ -374,7 +374,7 @@ void do_eject(int force, const char *fil
      eject_device(bs, force);
  }
  
@@ -607,7 +607,7 @@
  {
      BlockDriverState *bs;
      int i;
-@@ -368,6 +368,30 @@ void do_change(const char *device, const
+@@ -399,6 +399,30 @@ void do_change(const char *device, const
      }
  }
  
@@ -638,140 +638,25 @@
  static void do_screen_dump(const char *filename)
  {
      vga_hw_screen_dump(filename);
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/qemu_socket.h xen-3.1.0-src.new/tools/ioemu/qemu_socket.h
---- xen-3.1.0-src.orig/tools/ioemu/qemu_socket.h	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/qemu_socket.h	2007-10-10 17:31:52.000000000 -0400
-@@ -19,6 +19,7 @@
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>
-+#include <sys/un.h>
- 
- #define socket_error() errno
- #define closesocket(s) close(s)
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/vl.c xen-3.1.0-src.new/tools/ioemu/vl.c
---- xen-3.1.0-src.orig/tools/ioemu/vl.c	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vl.c	2007-10-10 17:31:52.000000000 -0400
-@@ -122,7 +122,6 @@ static DisplayState display_state;
- int nographic;
- int vncviewer;
- int vncunused;
--struct sockaddr_in vnclisten_addr;
- const char* keyboard_layout = NULL;
- int64_t ticks_per_sec;
- char *boot_device = NULL;
-@@ -151,7 +150,7 @@ int win2k_install_hack = 0;
- int usb_enabled = 0;
- static VLANState *first_vlan;
- int smp_cpus = 1;
--int vnc_display = -1;
-+const char *vnc_display;
- #if defined(TARGET_SPARC)
- #define MAX_CPUS 16
- #elif defined(TARGET_I386)
-@@ -5545,7 +5544,6 @@ enum {
-     QEMU_OPTION_acpi,
-     QEMU_OPTION_vncviewer,
-     QEMU_OPTION_vncunused,
--    QEMU_OPTION_vnclisten,
- };
- 
- typedef struct QEMUOption {
-@@ -5624,7 +5622,6 @@ const QEMUOption qemu_options[] = {
-     { "vnc", HAS_ARG, QEMU_OPTION_vnc },
-     { "vncviewer", 0, QEMU_OPTION_vncviewer },
-     { "vncunused", 0, QEMU_OPTION_vncunused },
--    { "vnclisten", HAS_ARG, QEMU_OPTION_vnclisten },
-     
-     /* temporary options */
-     { "usb", 0, QEMU_OPTION_usb },
-@@ -6031,8 +6028,6 @@ int main(int argc, char **argv)
-     nb_nics = 0;
-     /* default mac address of the first network interface */
- 
--    memset(&vnclisten_addr.sin_addr, 0, sizeof(vnclisten_addr.sin_addr));
--    
-     /* init debug */
-     sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%ld.log", (long)getpid());
-     cpu_set_log_filename(qemu_dm_logfilename);
-@@ -6383,11 +6378,7 @@ int main(int argc, char **argv)
-                 }
-                 break;
- 	    case QEMU_OPTION_vnc:
--		vnc_display = atoi(optarg);
--		if (vnc_display < 0) {
--		    fprintf(stderr, "Invalid VNC display\n");
--		    exit(1);
--		}
-+  		vnc_display = optarg;
- 		break;
-             case QEMU_OPTION_no_acpi:
-                 acpi_enabled = 0;
-@@ -6415,11 +6406,8 @@ int main(int argc, char **argv)
-                 break;
-             case QEMU_OPTION_vncunused:
-                 vncunused++;
--                if (vnc_display == -1)
--                    vnc_display = 0;
--                break;
--            case QEMU_OPTION_vnclisten:
--                parse_host(&vnclisten_addr, optarg);
-+                if (vnc_display == NULL)
-+                    vnc_display = ":0";
-                 break;
-             }
-         }
-@@ -6550,11 +6538,18 @@ int main(int argc, char **argv)
-     /* terminal init */
-     if (nographic) {
-         dumb_display_init(ds);
--    } else if (vnc_display != -1) {
--	vnc_display = vnc_display_init(ds, vnc_display, vncunused, &vnclisten_addr);
-+    } else if (vnc_display != NULL) {
-+        int vnc_port;
-+	char password[20];
-+        vnc_display_init(ds);
-+	if (xenstore_read_vncpasswd(domid, password, sizeof(password)) < 0)
-+	    exit(0);
-+	vnc_display_password(ds, password);
-+	if ((vnc_port = vnc_display_open(ds, vnc_display, vncunused)) < 0) 
-+	    exit (0);
- 	if (vncviewer)
--	    vnc_start_viewer(vnc_display);
--	xenstore_write_vncport(vnc_display);
-+	    vnc_start_viewer(vnc_port);
-+	xenstore_write_vncport(vnc_port);
-     } else {
- #if defined(CONFIG_SDL)
-         sdl_display_init(ds, full_screen);
-@@ -6626,7 +6621,7 @@ int main(int argc, char **argv)
-         }
-     }
- 
--    if (vnc_display == -1) {
-+    if (vnc_display == NULL) {
-         gui_timer = qemu_new_timer(rt_clock, gui_update, NULL);
-         qemu_mod_timer(gui_timer, qemu_get_clock(rt_clock));
-     }
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/vl.h xen-3.1.0-src.new/tools/ioemu/vl.h
---- xen-3.1.0-src.orig/tools/ioemu/vl.h	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vl.h	2007-10-10 17:31:52.000000000 -0400
-@@ -813,7 +813,10 @@ void sdl_display_init(DisplayState *ds, 
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/vl.h xen-unstable.hg-16125.new/tools/ioemu/vl.h
+--- xen-unstable.hg-16125.orig/tools/ioemu/vl.h	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/vl.h	2007-10-29 15:47:52.000000000 -0400
+@@ -943,7 +943,10 @@ void sdl_display_init(DisplayState *ds, 
  void cocoa_display_init(DisplayState *ds, int full_screen);
  
  /* vnc.c */
--int vnc_display_init(DisplayState *ds, int display, int find_unused, struct sockaddr_in *addr);
+-int vnc_display_init(DisplayState *ds, const char *display, int find_unused);
 +void vnc_display_init(DisplayState *ds);
 +void vnc_display_close(DisplayState *ds);
 +int vnc_display_open(DisplayState *ds, const char * display, int find_unused);
 +int vnc_display_password(DisplayState *ds, const char *password);
+ void do_info_vnc(void);
  int vnc_start_viewer(int port);
  
- /* ide.c */
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/vnc.c xen-3.1.0-src.new/tools/ioemu/vnc.c
---- xen-3.1.0-src.orig/tools/ioemu/vnc.c	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vnc.c	2007-10-10 20:24:32.000000000 -0400
-@@ -44,6 +44,28 @@
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/vnc.c xen-unstable.hg-16125.new/tools/ioemu/vnc.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/vnc.c	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/vnc.c	2007-10-29 16:24:50.000000000 -0400
+@@ -47,6 +47,28 @@
  
  #include "vnc_keysym.h"
  #include "keymaps.c"
@@ -798,9 +683,9 @@
 +#endif
 +
  
- #define XK_MISCELLANY
- #define XK_LATIN1
-@@ -74,6 +96,45 @@ typedef void VncSendHextileTile(VncState
+ typedef struct Buffer
+ {
+@@ -73,6 +95,45 @@ typedef void VncSendHextileTile(VncState
  #define VNC_DIRTY_WORDS (VNC_MAX_WIDTH / (16 * 32))
  #endif
  
@@ -846,11 +731,11 @@
  struct VncState
  {
      QEMUTimer *timer;
-@@ -93,6 +154,29 @@ struct VncState
-     int depth; /* internal VNC frame buffer byte per pixel */
-     int has_resize;
-     int has_hextile;
-+
+@@ -97,7 +158,27 @@ struct VncState
+     int last_x;
+     int last_y;
+ 
+-    const char *display;
 +    int major;
 +    int minor;
 +
@@ -872,20 +757,10 @@
 +    int wiremode;
 +    gnutls_session_t tls_session;
 +#endif
-+
+ 
      Buffer output;
      Buffer input;
-     kbd_layout_t *kbd_layout;
-@@ -117,6 +201,8 @@ struct VncState
-     int numlock;
- };
- 
-+static VncState *vnc_state; /* needed for info vnc */
-+
- #define DIRTY_PIXEL_BITS 64
- #define X2DP_DOWN(vs, x) ((x) >> (vs)->dirty_pixel_shift)
- #define X2DP_UP(vs, x) \
-@@ -672,11 +758,19 @@ static int vnc_client_io_error(VncState 
+@@ -698,11 +779,19 @@ static int vnc_client_io_error(VncState 
  	if (ret == -1 && (last_errno == EINTR || last_errno == EAGAIN))
  	    return 0;
  
@@ -905,7 +780,7 @@
  	return 0;
      }
      return ret;
-@@ -692,7 +786,19 @@ static void vnc_client_write(void *opaqu
+@@ -718,7 +807,19 @@ static void vnc_client_write(void *opaqu
      long ret;
      VncState *vs = opaque;
  
@@ -926,7 +801,7 @@
      ret = vnc_client_io_error(vs, ret, socket_error());
      if (!ret)
  	return;
-@@ -718,7 +824,19 @@ static void vnc_client_read(void *opaque
+@@ -744,7 +845,19 @@ static void vnc_client_read(void *opaque
  
      buffer_reserve(&vs->input, 4096);
  
@@ -947,7 +822,7 @@
      ret = vnc_client_io_error(vs, ret, socket_error());
      if (!ret)
  	return;
-@@ -815,6 +933,41 @@ static uint32_t read_u32(uint8_t *data, 
+@@ -841,6 +954,41 @@ static uint32_t read_u32(uint8_t *data, 
  	    (data[offset + 2] << 8) | data[offset + 3]);
  }
  
@@ -989,7 +864,7 @@
  static void client_cut_text(VncState *vs, size_t len, char *text)
  {
  }
-@@ -1257,23 +1410,587 @@ static int protocol_client_init(VncState
+@@ -1384,23 +1532,588 @@ static int protocol_client_init(VncState
  }
  
  
@@ -1543,6 +1418,7 @@
 +    VNC_DEBUG("Client request protocol version %d.%d\n", vs->major, vs->minor);
 +    if (vs->major != 3 ||
 +	(vs->minor != 3 &&
++	 vs->minor != 4 &&
 +	 vs->minor != 5 &&
 +	 vs->minor != 7 &&
 +	 vs->minor != 8)) {
@@ -1552,10 +1428,10 @@
 +	vnc_client_error(vs);
 +	return 0;
 +    }
-+    /* Some broken client report v3.5 which spec requires to be treated
++    /* Some broken clients report v3.4 or v3.5, which spec requires to be treated
 +     * as equivalent to v3.3 by servers
 +     */
-+    if (vs->minor == 5)
++    if (vs->minor == 4 || vs->minor == 5)
 +	vs->minor = 3;
 +
 +    if (vs->minor == 3) {
@@ -1585,7 +1461,7 @@
  
      return 0;
  }
-@@ -1286,9 +2003,10 @@ static void vnc_listen_read(void *opaque
+@@ -1413,9 +2126,10 @@ static void vnc_listen_read(void *opaque
  
      vs->csock = accept(vs->lsock, (struct sockaddr *)&addr, &addrlen);
      if (vs->csock != -1) {
@@ -1597,50 +1473,43 @@
  	vnc_flush(vs);
  	vnc_read_when(vs, protocol_version, 12);
  	framebuffer_set_updated(vs, 0, 0, vs->ds->width, vs->ds->height);
-@@ -1299,9 +2017,8 @@ static void vnc_listen_read(void *opaque
-     }
- }
+@@ -1428,16 +2142,8 @@ static void vnc_listen_read(void *opaque
+ 
+ extern int parse_host_port(struct sockaddr_in *saddr, const char *str);
  
--int vnc_display_init(DisplayState *ds, int display, int find_unused, struct sockaddr_in *addr)
+-int vnc_display_init(DisplayState *ds, const char *arg, int find_unused)
 +void vnc_display_init(DisplayState *ds)
  {
+-    struct sockaddr *addr;
+-    struct sockaddr_in iaddr;
+-#ifndef _WIN32
+-    struct sockaddr_un uaddr;
+-#endif
 -    int reuse_addr, ret;
+-    socklen_t addrlen;
+-    const char *p;
      VncState *vs;
  
      vs = qemu_mallocz(sizeof(VncState));
-@@ -1309,11 +2026,13 @@ int vnc_display_init(DisplayState *ds, i
- 	exit(1);
+@@ -1446,7 +2152,8 @@ int vnc_display_init(DisplayState *ds, c
  
      ds->opaque = vs;
-+    vnc_state = vs;
+     vnc_state = vs;
+-    vs->display = arg;
 +    vs->display = NULL;
 +    vs->password = NULL;
  
      vs->lsock = -1;
      vs->csock = -1;
-     vs->depth = 4;
--    vs->numlock = 0;
+@@ -1470,19 +2177,238 @@ int vnc_display_init(DisplayState *ds, c
+     vs->ds->dpy_refresh = vnc_dpy_refresh;
  
-     vs->ds = ds;
- 
-@@ -1324,51 +2043,312 @@ int vnc_display_init(DisplayState *ds, i
-     if (!vs->kbd_layout)
- 	exit(1);
- 
--    vs->lsock = socket(PF_INET, SOCK_STREAM, 0);
--    if (vs->lsock == -1) {
--	fprintf(stderr, "Could not create socket\n");
--	exit(1);
-+    vs->ds->data = NULL;
-+    vs->ds->dpy_update = vnc_dpy_update;
-+    vs->ds->dpy_resize = vnc_dpy_resize;
-+    vs->ds->dpy_refresh = vnc_dpy_refresh;
-+
-+    vnc_dpy_resize(vs->ds, 640, 400);
-+
-+    memset(vs->dirty_row, 0xFF, sizeof(vs->dirty_row));
+     vnc_dpy_resize(vs->ds, 640, 400);
 +}
-+
+ 
+-    if (arg == NULL)
+-	arg = "localhost:0";
+-    
 +#if CONFIG_VNC_TLS
 +static int vnc_set_x509_credential(VncState *vs,
 +				   const char *certdir,
@@ -1653,14 +1522,8 @@
 +    if (*cred) {
 +	qemu_free(*cred);
 +	*cred = NULL;
-     }
- 
--    reuse_addr = 1;
--    ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR,
--		     (const char *)&reuse_addr, sizeof(reuse_addr));
--    if (ret == -1) {
--	fprintf(stderr, "setsockopt() failed\n");
--	exit(1);
++    }
++
 +    if (!(*cred = qemu_malloc(strlen(certdir) + strlen(filename) + 2)))
 +	return -1;
 +
@@ -1675,18 +1538,11 @@
 +	if (ignoreMissing && errno == ENOENT)
 +	    return 0;
 +	return -1;
-     }
- 
-- retry:
--    addr->sin_family = AF_INET;
--    addr->sin_port = htons(5900 + display);
++    }
++
 +    return 0;
 +}
- 
--    if (bind(vs->lsock, (struct sockaddr *)addr, sizeof(struct sockaddr_in)) == -1) {
--	if (find_unused && errno == EADDRINUSE) {
--	    display++;
--	    goto retry;
++
 +static int vnc_set_x509_credential_dir(VncState *vs,
 +				       const char *certdir)
 +{
@@ -1734,22 +1590,17 @@
 +	if (vs->tls_session) {
 +	    gnutls_deinit(vs->tls_session);
 +	    vs->tls_session = NULL;
- 	}
--	fprintf(stderr, "bind() failed\n");
--	exit(1);
++	}
 +	vs->wiremode = VNC_WIREMODE_CLEAR;
 +#endif /* CONFIG_VNC_TLS */
-     }
++    }
 +    vs->auth = VNC_AUTH_INVALID;
 +#if CONFIG_VNC_TLS
 +    vs->subauth = VNC_AUTH_INVALID;
 +    vs->x509verify = 0;
 +#endif
 +}
- 
--    if (listen(vs->lsock, 1) == -1) {
--	fprintf(stderr, "listen() failed\n");
--	exit(1);
++
 +int parse_host_port(struct sockaddr_in *saddr, const char *str);
 +
 +
@@ -1765,24 +1616,17 @@
 +    if (password && password[0]) {
 +	if (!(vs->password = qemu_strdup(password)))
 +	    return -1;
-     }
- 
--    ret = qemu_set_fd_handler2(vs->lsock, vnc_listen_poll, vnc_listen_read,
--			       NULL, vs);
--    if (ret == -1)
--	exit(1);
++    }
++
 +    return 0;
 +}
- 
--    vs->ds->data = NULL;
--    vs->ds->dpy_update = vnc_dpy_update;
--    vs->ds->dpy_resize = vnc_dpy_resize;
--    vs->ds->dpy_refresh = vnc_dpy_refresh;
++
 +int vnc_display_open(DisplayState *ds, const char *display, int find_unused)
 +{
 +    struct sockaddr *addr;
 +    struct sockaddr_in iaddr;
-+#ifndef _WIN32
+ #ifndef _WIN32
+-    if (strstart(arg, "unix:", &p)) {
 +    struct sockaddr_un uaddr;
 +#endif
 +    int reuse_addr, ret;
@@ -1794,8 +1638,10 @@
 +#if CONFIG_VNC_TLS
 +    int tls = 0, x509 = 0;
 +#endif
- 
--    vnc_dpy_resize(vs->ds, 640, 400);
++
++    if (display == NULL)
++	display = "localhost:0";
++
 +    vnc_display_close(ds);
 +    if (strcmp(display, "none") == 0)
 +        return 0;
@@ -1886,132 +1732,122 @@
 +    }
 +#ifndef _WIN32
 +    if (strstart(display, "unix:", &p)) {
-+        addr = (struct sockaddr *)&uaddr;
-+        addrlen = sizeof(uaddr);
-+
-+        vs->lsock = socket(PF_UNIX, SOCK_STREAM, 0);
-+        if (vs->lsock == -1) {
-+            fprintf(stderr, "Could not create socket\n");
-+            free(vs->display);
-+            vs->display = NULL;
-+            return -1;
-+        }
-+
-+        uaddr.sun_family = AF_UNIX;
-+        memset(uaddr.sun_path, 0, 108);
-+        snprintf(uaddr.sun_path, 108, "%s", p);
-+
-+        unlink(uaddr.sun_path);
-+    } else
-+#endif
-+    {
-+        addr = (struct sockaddr *)&iaddr;
-+        addrlen = sizeof(iaddr);
-+
-+        if (parse_host_port(&iaddr, display) < 0) {
-+            fprintf(stderr, "Could not parse VNC address\n");
-+            free(vs->display);
-+            vs->display = NULL;
-+            return -1;
-+        }
-+
-+        iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 5900);
-+
-+        vs->lsock = socket(PF_INET, SOCK_STREAM, 0);
-+        if (vs->lsock == -1) {
-+            fprintf(stderr, "Could not create socket\n");
-+            free(vs->display);
-+            vs->display = NULL;
-+            return -1;
-+        }
-+
-+        reuse_addr = 1;
-+        ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR,
-+                         (const char *)&reuse_addr, sizeof(reuse_addr));
-+        if (ret == -1) {
-+            fprintf(stderr, "setsockopt() failed\n");
-+            close(vs->lsock);
-+            vs->lsock = -1;
-+            free(vs->display);
-+            vs->display = NULL;
-+            return -1;
-+        }
-+    }
-+
-+    while (bind(vs->lsock, addr, addrlen) == -1) {
-+        if (find_unused && errno == EADDRINUSE) {
-+	    iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 1);
-+	    continue;
-+	}
-+        fprintf(stderr, "bind() failed\n");
-+        close(vs->lsock);
-+        vs->lsock = -1;
-+        free(vs->display);
-+        vs->display = NULL;
-+        return -1;
-+    }
+ 	addr = (struct sockaddr *)&uaddr;
+ 	addrlen = sizeof(uaddr);
+ 
+ 	vs->lsock = socket(PF_UNIX, SOCK_STREAM, 0);
+ 	if (vs->lsock == -1) {
+ 	    fprintf(stderr, "Could not create socket\n");
+-	    exit(1);
++	    free(vs->display);
++	    vs->display = NULL;
++	    return -1;
+ 	}
+ 
+ 	uaddr.sun_family = AF_UNIX;
+@@ -1496,25 +2422,33 @@ int vnc_display_init(DisplayState *ds, c
+ 	addr = (struct sockaddr *)&iaddr;
+ 	addrlen = sizeof(iaddr);
+ 
++	if (parse_host_port(&iaddr, display) < 0) {
++	    fprintf(stderr, "Could not parse VNC address\n");
++	    free(vs->display);
++	    vs->display = NULL;
++	    return -1;
++	}
 +
-+    if (listen(vs->lsock, 1) == -1) {
-+        fprintf(stderr, "listen() failed\n");
-+        close(vs->lsock);
-+        vs->lsock = -1;
-+        free(vs->display);
-+        vs->display = NULL;
-+        return -1;
-+    }
++	iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 5900);
 +
-+    if (qemu_set_fd_handler2(vs->lsock, vnc_listen_poll, vnc_listen_read, NULL, vs) < 0)
+ 	vs->lsock = socket(PF_INET, SOCK_STREAM, 0);
+ 	if (vs->lsock == -1) {
+ 	    fprintf(stderr, "Could not create socket\n");
+-	    exit(1);
++	    free(vs->display);
++	    vs->display = NULL;
++	    return -1;
+ 	}
+ 
+-	if (parse_host_port(&iaddr, arg) < 0) {
+-	    fprintf(stderr, "Could not parse VNC address\n");
+-	    exit(1);
+-	}
+-	    
+-	iaddr.sin_port = htons(ntohs(iaddr.sin_port) + 5900);
+-
+ 	reuse_addr = 1;
+ 	ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR,
+ 			 (const char *)&reuse_addr, sizeof(reuse_addr));
+ 	if (ret == -1) {
+ 	    fprintf(stderr, "setsockopt() failed\n");
+-	    exit(1);
++	    close(vs->lsock);
++	    vs->lsock = -1;
++	    free(vs->display);
++	    vs->display = NULL;
++	    return -1;
+ 	}
+     }
+ 
+@@ -1524,18 +2458,24 @@ int vnc_display_init(DisplayState *ds, c
+ 	    continue;
+ 	}
+ 	fprintf(stderr, "bind() failed\n");
+-	exit(1);
++	close(vs->lsock);
++	vs->lsock = -1;
++	free(vs->display);
++	vs->display = NULL;
 +	return -1;
+     }
  
--    return display;
-+    return ntohs(iaddr.sin_port);
- }
+     if (listen(vs->lsock, 1) == -1) {
+ 	fprintf(stderr, "listen() failed\n");
+-	exit(1);
++	close(vs->lsock);
++	vs->lsock = -1;
++	free(vs->display);
++	vs->display = NULL;
++	return -1;
+     }
  
- int vnc_start_viewer(int port)
-diff -rupN xen-3.1.0-src.orig/tools/ioemu/xenstore.c xen-3.1.0-src.new/tools/ioemu/xenstore.c
---- xen-3.1.0-src.orig/tools/ioemu/xenstore.c	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/xenstore.c	2007-10-10 17:31:52.000000000 -0400
-@@ -367,7 +367,7 @@ void xenstore_write_vncport(int display)
-     if (pasprintf(&buf, "%s/console/vnc-port", path) == -1)
-         goto out;
- 
--    if (pasprintf(&portstr, "%d", 5900 + display) == -1)
-+    if (pasprintf(&portstr, "%d", display) == -1)
-         goto out;
+-    ret = qemu_set_fd_handler2(vs->lsock, vnc_listen_poll, vnc_listen_read, NULL, vs);
+-    if (ret == -1) {
+-	exit(1);
+-    }
++    if (qemu_set_fd_handler2(vs->lsock, vnc_listen_poll, vnc_listen_read, NULL, vs) < 0)
++	return -1;
  
-     if (xs_write(xsh, XBT_NULL, buf, portstr, strlen(portstr)) == 0)
-@@ -405,6 +405,7 @@ int xenstore_read_vncpasswd(int domid, c
+     return ntohs(iaddr.sin_port);
+ }
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/xenstore.c xen-unstable.hg-16125.new/tools/ioemu/xenstore.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/xenstore.c	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/xenstore.c	2007-10-29 16:07:00.000000000 -0400
+@@ -505,6 +505,7 @@ int xenstore_read_vncpasswd(int domid, c
      passwd = xs_read(xsh, XBT_NULL, buf, &len);
      if (passwd == NULL) {
          fprintf(logfile, "xs_read(): vncpasswd get error. %s.\n", buf);
-+	pwbuf[0] = '\0';
++        pwbuf[0] = '\0';
          free(uuid);
          free(path);
          return rc;
-diff -rupN xen-3.1.0-src.orig/tools/python/xen/xend/image.py xen-3.1.0-src.new/tools/python/xen/xend/image.py
---- xen-3.1.0-src.orig/tools/python/xen/xend/image.py	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/image.py	2007-10-10 20:19:46.000000000 -0400
-@@ -30,6 +30,7 @@ from xen.xend.XendOptions import instanc
- from xen.xend.server.netif import randomMAC
+diff -rupN xen-unstable.hg-16125.orig/tools/python/xen/xend/image.py xen-unstable.hg-16125.new/tools/python/xen/xend/image.py
+--- xen-unstable.hg-16125.orig/tools/python/xen/xend/image.py	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/python/xen/xend/image.py	2007-10-29 16:04:35.000000000 -0400
+@@ -31,6 +31,7 @@ from xen.xend.XendOptions import instanc
+ from xen.xend.xenstore.xstransact import xstransact
  from xen.xend.xenstore.xswatch import xswatch
  from xen.xend import arch
 +from xen.xend import XendOptions
  
  xc = xen.lowlevel.xc.xc()
  
-@@ -387,30 +388,26 @@ class HVMImageHandler(ImageHandler):
+@@ -214,27 +215,26 @@ class ImageHandler:
+                             'vncpasswd'):
                      if key in vmConfig['platform']:
                          vnc_config[key] = vmConfig['platform'][key]
- 
--            if not vnc_config.get('vncunused', 0) and \
--                   vnc_config.get('vncdisplay', 0):
--                vncdisplay = vnc_config.get('vncdisplay')
--                ret.append('-vnc')
--                ret.append(str(vncdisplay))
 +            if vnc_config.has_key("vncpasswd"):
 +                passwd = vnc_config["vncpasswd"]
-             else:
--                ret.append('-vncunused')
++            else:
 +                passwd = XendOptions.instance().get_vncpasswd_default()
 +            vncopts = ""
 +            if passwd:
@@ -2023,8 +1859,15 @@
  
              vnclisten = vnc_config.get('vnclisten',
 -                                       xenopts().get_vnclisten_address())
--            ret.append('-vnclisten')
--            ret.append(str(vnclisten))
++                                       XendOptions.instance().get_vnclisten_address())
+             vncdisplay = vnc_config.get('vncdisplay', 0)
+             ret.append('-vnc')
+-            ret.append("%s:%d" % (vnclisten, vncdisplay))
+-            
++            ret.append("%s:%d%s" % (vnclisten, vncdisplay, vncopts))
++
+             if vnc_config.get('vncunused', 0):
+                 ret.append('-vncunused')
 -
 -            # Store vncpassword in xenstore
 -            vncpasswd = vnc_config.get('vncpasswd')
@@ -2034,38 +1877,9 @@
 -            if vncpasswd is None:
 -                raise VmError('vncpasswd is not setup in vmconfig or '
 -                              'xend-config.sxp')
-+                                       XendOptions.instance().get_vnclisten_address())
-+            vncdisplay = vnc_config.get('vncdisplay', 0)
-+            ret.append('-vnc')
-+            ret.append("%s:%d%s" % (vnclisten, vncdisplay, vncopts))
- 
+-
 -            if vncpasswd != '':
 -                self.vm.storeVm('vncpasswd', vncpasswd)
-+            if vnc_config.get('vncunused', 0):
-+                ret.append('-vncunused')
          elif has_sdl:
              # SDL is default in QEMU.
              pass
-diff -rupN xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py
---- xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py	2007-10-10 20:20:09.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py	2007-10-10 17:31:52.000000000 -0400
-@@ -69,8 +69,10 @@ class VfbifController(DevController):
-                 passwd = config["vncpasswd"]
-             else:
-                 passwd = xen.xend.XendOptions.instance().get_vncpasswd_default()
-+            vncopts = ""
-             if passwd:
-                 self.vm.storeVm("vncpasswd", passwd)
-+                vncopts = vncopts + ",password"
-                 log.debug("Stored a VNC password for vfb access")
-             else:
-                 log.debug("No VNC passwd configured for vfb access")
-@@ -78,7 +80,7 @@ class VfbifController(DevController):
-             vnclisten = config.get('vnclisten',
-                                    xen.xend.XendOptions.instance().get_vnclisten_address())
-             vncdisplay = config.get('vncdisplay', 0)
--            args += ['-vnc', "%s:%d" % (vnclisten, int(vncdisplay))]
-+            args += ['-vnc', "%s:%d%s" % (vnclisten, int(vncdisplay), vncopts)]
- 
-             if config.get('vncunused', 0):
-                 args += ['-vncunused']

xen-qemu-vnc-revert-password.patch:

Index: xen-qemu-vnc-revert-password.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen-qemu-vnc-revert-password.patch,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xen-qemu-vnc-revert-password.patch	28 Aug 2007 21:49:31 -0000	1.1
+++ xen-qemu-vnc-revert-password.patch	29 Oct 2007 20:35:49 -0000	1.1.2.1
@@ -1,6 +1,6 @@
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/d3des.c xen-3.1.0-src.new/tools/ioemu/d3des.c
---- xen-3.1.0-src.orig/tools/ioemu/d3des.c	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/d3des.c	1969-12-31 19:00:00.000000000 -0500
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/d3des.c xen-unstable.hg-16125.new/tools/ioemu/d3des.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/d3des.c	2007-10-19 09:51:31.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/d3des.c	1969-12-31 19:00:00.000000000 -0500
 @@ -1,434 +0,0 @@
 -/*
 - * This is D3DES (V5.09) by Richard Outerbridge with the double and
@@ -436,9 +436,9 @@
 - *
 - * d3des V5.0a rwo 9208.07 18:44 Graven Imagery
 - **********************************************************************/
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/d3des.h xen-3.1.0-src.new/tools/ioemu/d3des.h
---- xen-3.1.0-src.orig/tools/ioemu/d3des.h	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/d3des.h	1969-12-31 19:00:00.000000000 -0500
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/d3des.h xen-unstable.hg-16125.new/tools/ioemu/d3des.h
+--- xen-unstable.hg-16125.orig/tools/ioemu/d3des.h	2007-10-19 09:51:31.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/d3des.h	1969-12-31 19:00:00.000000000 -0500
 @@ -1,51 +0,0 @@
 -/*
 - * This is D3DES (V5.09) by Richard Outerbridge with the double and
@@ -491,32 +491,32 @@
 -
 -/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
 - ********************************************************************/
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tools/ioemu/Makefile.target
---- xen-3.1.0-src.orig/tools/ioemu/Makefile.target	2007-08-23 15:33:41.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/Makefile.target	2007-08-23 15:35:32.000000000 -0400
-@@ -412,7 +412,6 @@ ifdef CONFIG_SDL
- VL_OBJS+=sdl.o
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/Makefile.target xen-unstable.hg-16125.new/tools/ioemu/Makefile.target
+--- xen-unstable.hg-16125.orig/tools/ioemu/Makefile.target	2007-10-29 15:38:10.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/Makefile.target	2007-10-29 15:39:32.000000000 -0400
+@@ -457,7 +457,6 @@ ifdef CONFIG_SDL
+ VL_OBJS+=sdl.o x_keymap.o
  endif
  VL_OBJS+=vnc.o
 -VL_OBJS+=d3des.o
  ifdef CONFIG_COCOA
  VL_OBJS+=cocoa.o
  COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
-@@ -473,9 +472,6 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h
+@@ -518,9 +517,6 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h
  vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
- 	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
  
 -d3des.o: d3des.c d3des.h
 -	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
 -
  sdlaudio.o: sdlaudio.c
- 	$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
  
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/vl.c xen-3.1.0-src.new/tools/ioemu/vl.c
---- xen-3.1.0-src.orig/tools/ioemu/vl.c	2007-08-23 15:33:41.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vl.c	2007-08-23 15:35:32.000000000 -0400
-@@ -171,9 +171,6 @@ time_t timeoffset = 0;
- char domain_name[1024] = "Xen-no-name";
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/vl.c xen-unstable.hg-16125.new/tools/ioemu/vl.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/vl.c	2007-10-29 15:38:10.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/vl.c	2007-10-29 15:39:32.000000000 -0400
+@@ -196,9 +196,6 @@ int xc_handle;
+ char domain_name[64] = "Xen-no-name";
  extern int domid;
  
 -char vncpasswd[64];
@@ -525,7 +525,7 @@
  /***********************************************************/
  /* x86 ISA bus support */
  
-@@ -6004,7 +6001,6 @@ int main(int argc, char **argv)
+@@ -7039,7 +7036,6 @@ int main(int argc, char **argv)
      vncunused = 0;
      kernel_filename = NULL;
      kernel_cmdline = "";
@@ -533,7 +533,7 @@
  #ifndef CONFIG_DM
  #ifdef TARGET_PPC
      cdrom_index = 1;
-@@ -6553,10 +6549,6 @@ int main(int argc, char **argv)
+@@ -7684,10 +7680,6 @@ int main(int argc, char **argv)
  
      init_ioports();
  
@@ -544,11 +544,11 @@
      /* terminal init */
      if (nographic) {
          dumb_display_init(ds);
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/vl.h xen-3.1.0-src.new/tools/ioemu/vl.h
---- xen-3.1.0-src.orig/tools/ioemu/vl.h	2007-08-23 15:33:41.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vl.h	2007-08-23 15:40:33.000000000 -0400
-@@ -1246,7 +1246,7 @@ int xenstore_fd(void);
- void xenstore_process_event(void *opaque);
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/vl.h xen-unstable.hg-16125.new/tools/ioemu/vl.h
+--- xen-unstable.hg-16125.orig/tools/ioemu/vl.h	2007-10-29 15:38:10.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/vl.h	2007-10-29 15:40:00.000000000 -0400
+@@ -1453,7 +1453,7 @@ void xenstore_process_event(void *opaque
+ void xenstore_record_dm_state(char *state);
  void xenstore_check_new_media_present(int timeout);
  void xenstore_write_vncport(int vnc_display);
 -int xenstore_read_vncpasswd(int domid);
@@ -556,26 +556,28 @@
  
  int xenstore_domain_has_devtype(struct xs_handle *handle,
                                  const char *devtype);
-@@ -1283,7 +1283,4 @@ extern char domain_name[];
+@@ -1490,9 +1490,6 @@ extern char domain_name[];
  
  void destroy_hvm_domain(void);
  
 -/* VNC Authentication */
 -#define AUTHCHALLENGESIZE 16
 -
- #endif /* VL_H */
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/vnc.c xen-3.1.0-src.new/tools/ioemu/vnc.c
---- xen-3.1.0-src.orig/tools/ioemu/vnc.c	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/vnc.c	2007-08-23 15:42:10.000000000 -0400
-@@ -44,7 +44,6 @@
+ #ifdef __ia64__
+ static inline void xc_domain_shutdown_hook(int xc_handle, uint32_t domid)
+ {
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/vnc.c xen-unstable.hg-16125.new/tools/ioemu/vnc.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/vnc.c	2007-10-19 09:51:32.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/vnc.c	2007-10-29 15:39:32.000000000 -0400
+@@ -47,7 +47,6 @@
  
  #include "vnc_keysym.h"
  #include "keymaps.c"
 -#include "d3des.h"
  
- #define XK_MISCELLANY
- #define XK_LATIN1
-@@ -140,9 +139,6 @@ static void _vnc_update_client(void *opa
+ typedef struct Buffer
+ {
+@@ -164,9 +163,6 @@ static void _vnc_update_client(void *opa
  static void vnc_update_client(void *opaque);
  static void vnc_client_read(void *opaque);
  static void framebuffer_set_updated(VncState *vs, int x, int y, int w, int h);
@@ -585,7 +587,7 @@
  
  #if 0
  static inline void vnc_set_bit(uint32_t *d, int k)
-@@ -1260,92 +1256,24 @@ static int protocol_client_init(VncState
+@@ -1387,92 +1383,24 @@ static int protocol_client_init(VncState
      return 0;
  }
  
@@ -683,7 +685,7 @@
  
      return 0;
  }
-@@ -1471,31 +1399,3 @@ int vnc_start_viewer(int port)
+@@ -1640,31 +1568,3 @@ int vnc_start_viewer(int port)
      }
  }
  
@@ -715,10 +717,10 @@
 -
 -    return;
 -}
-diff -ruNp xen-3.1.0-src.orig/tools/ioemu/xenstore.c xen-3.1.0-src.new/tools/ioemu/xenstore.c
---- xen-3.1.0-src.orig/tools/ioemu/xenstore.c	2007-08-23 15:33:41.000000000 -0400
-+++ xen-3.1.0-src.new/tools/ioemu/xenstore.c	2007-08-23 15:40:29.000000000 -0400
-@@ -378,9 +378,8 @@ void xenstore_write_vncport(int display)
+diff -rupN xen-unstable.hg-16125.orig/tools/ioemu/xenstore.c xen-unstable.hg-16125.new/tools/ioemu/xenstore.c
+--- xen-unstable.hg-16125.orig/tools/ioemu/xenstore.c	2007-10-29 15:38:10.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/ioemu/xenstore.c	2007-10-29 15:39:32.000000000 -0400
+@@ -478,9 +478,8 @@ void xenstore_write_vncport(int display)
      free(buf);
  }
  
@@ -729,7 +731,7 @@
      char *buf = NULL, *path, *uuid = NULL, *passwd = NULL;
      unsigned int i, len, rc = 0;
  
-@@ -411,11 +410,11 @@ int xenstore_read_vncpasswd(int domid)
+@@ -511,11 +510,11 @@ int xenstore_read_vncpasswd(int domid)
          return rc;
      }
  

xen-qemu-vnc-x509-certs.patch:

Index: xen-qemu-vnc-x509-certs.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen-qemu-vnc-x509-certs.patch,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xen-qemu-vnc-x509-certs.patch	11 Oct 2007 00:47:59 -0000	1.1
+++ xen-qemu-vnc-x509-certs.patch	29 Oct 2007 20:35:49 -0000	1.1.2.1
@@ -1,13 +1,12 @@
-diff -rup xen-3.1.0-src.orig/tools/examples/xend-config.sxp xen-3.1.0-src.new/tools/examples/xend-config.sxp
---- xen-3.1.0-src.orig/tools/examples/xend-config.sxp	2007-10-10 17:31:42.000000000 -0400
-+++ xen-3.1.0-src.new/tools/examples/xend-config.sxp	2007-10-10 17:55:25.000000000 -0400
-@@ -202,3 +202,33 @@
- # The default password for VNC console on HVM domain.
+diff -rupN xen-unstable.hg-16125.orig/tools/examples/xend-config.sxp xen-unstable.hg-16125.new/tools/examples/xend-config.sxp
+--- xen-unstable.hg-16125.orig/tools/examples/xend-config.sxp	2007-10-29 15:44:44.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/examples/xend-config.sxp	2007-10-29 16:29:58.000000000 -0400
+@@ -194,6 +194,36 @@
  # Empty string is no authentication.
  (vncpasswd '')
-+
+ 
 +# The VNC server can be told to negotiate a TLS session
-+# to encryption all traffic, and provide x509 cert to 
++# to encryption all traffic, and provide x509 cert to
 +# clients enalbing them to verify server identity. The
 +# GTK-VNC widget, virt-viewer, virt-manager and VeNCrypt
 +# all support the VNC extension for TLS used in QEMU. The
@@ -22,11 +21,11 @@
 +#
 +# and then uncomment this next line
 +# (vnc-tls 1)
-+#
++
 +# The certificate dir can be pointed elsewhere..
 +#
 +# (vnc-x509-cert-dir /etc/xen/vnc)
-+# 
++
 +# The server can be told to request & validate an x509
 +# certificate from the client. Only clients with a cert
 +# signed by the trusted CA will be able to connect. This
@@ -35,9 +34,13 @@
 +# checking uncomment this:
 +#
 +# (vnc-x509-verify 1)
-diff -rup xen-3.1.0-src.orig/tools/python/xen/xend/image.py xen-3.1.0-src.new/tools/python/xen/xend/image.py
---- xen-3.1.0-src.orig/tools/python/xen/xend/image.py	2007-10-10 17:31:42.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/image.py	2007-10-10 19:54:22.000000000 -0400
++
+ # The default keymap to use for the VM's virtual keyboard
+ # when not specififed in VM's configuration
+ #(keymap 'en-us')
+diff -rupN xen-unstable.hg-16125.orig/tools/python/xen/xend/image.py xen-unstable.hg-16125.new/tools/python/xen/xend/image.py
+--- xen-unstable.hg-16125.orig/tools/python/xen/xend/image.py	2007-10-29 16:27:22.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/python/xen/xend/image.py	2007-10-29 16:27:42.000000000 -0400
 @@ -17,7 +17,7 @@
  #============================================================================
  
@@ -46,8 +49,8 @@
 +import os, os.path, string
  import re
  import math
- import signal
-@@ -400,6 +400,19 @@ class HVMImageHandler(ImageHandler):
+ import time
+@@ -227,6 +227,19 @@ class ImageHandler:
              else:
                  log.debug("No VNC passwd configured for vfb access")
  
@@ -67,9 +70,9 @@
              vnclisten = vnc_config.get('vnclisten',
                                         XendOptions.instance().get_vnclisten_address())
              vncdisplay = vnc_config.get('vncdisplay', 0)
-diff -rup xen-3.1.0-src.orig/tools/python/xen/xend/XendOptions.py xen-3.1.0-src.new/tools/python/xen/xend/XendOptions.py
---- xen-3.1.0-src.orig/tools/python/xen/xend/XendOptions.py	2007-05-18 10:45:21.000000000 -0400
-+++ xen-3.1.0-src.new/tools/python/xen/xend/XendOptions.py	2007-10-10 17:55:49.000000000 -0400
+diff -rupN xen-unstable.hg-16125.orig/tools/python/xen/xend/XendOptions.py xen-unstable.hg-16125.new/tools/python/xen/xend/XendOptions.py
+--- xen-unstable.hg-16125.orig/tools/python/xen/xend/XendOptions.py	2007-10-19 09:51:32.000000000 -0400
++++ xen-unstable.hg-16125.new/tools/python/xen/xend/XendOptions.py	2007-10-29 16:27:42.000000000 -0400
 @@ -102,6 +102,15 @@ class XendOptions:
      """Default interface to listen for VNC connections on"""
      xend_vnc_listen_default = '127.0.0.1'
@@ -87,8 +90,8 @@
      xend_domains_path_default = '/var/lib/xend/domains'
  
 @@ -278,6 +287,16 @@ class XendOptions:
-         return self.get_config_string('vncpasswd',
-                                      self.vncpasswd_default)
+     def get_keymap(self):
+         return self.get_config_value('keymap', None)
  
 +    def get_vnc_tls(self):
 +        return self.get_config_string('vnc-tls', self.xend_vnc_tls)


Index: xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen.spec,v
retrieving revision 1.194.2.4
retrieving revision 1.194.2.5
diff -u -r1.194.2.4 -r1.194.2.5
--- xen.spec	29 Oct 2007 18:44:22 -0000	1.194.2.4
+++ xen.spec	29 Oct 2007 20:35:49 -0000	1.194.2.5
@@ -135,14 +135,15 @@
 %patch167 -p1
 %patch168 -p1
 %patch169 -p1
+%patch170 -p1
 
 # Remove old VNC password code
-#patch170 -p1
+%patch171 -p1
 
 # Add new TLS code
-#patch171 -p1
-#patch172 -p1
-#patch173 -p1
+%patch172 -p1
+%patch173 -p1
+%patch174 -p1
 
 # upstream patches
 %patch251 -p1




More information about the scm-commits mailing list