Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CVDQx-0003yz-Hy for qemu-devel@nongnu.org; Fri, 19 Nov 2004 13:24:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CVDQw-0003yT-Lw for qemu-devel@nongnu.org; Fri, 19 Nov 2004 13:24:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVDQw-0003yJ-H7 for qemu-devel@nongnu.org; Fri, 19 Nov 2004 13:24:34 -0500 Received: from [193.17.41.31] (helo=rekin11.go2.pl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CVDHm-0001iV-Kg for qemu-devel@nongnu.org; Fri, 19 Nov 2004 13:15:07 -0500 Received: from poczta.o2.pl (rekin11 [127.0.0.1]) by rekin11.go2.pl (o2.pl Mailer 2.0.1) with ESMTP id 2C58638183 for ; Fri, 19 Nov 2004 19:13:28 +0100 (CET) From: =?iso-8859-2?Q?Piotr_R.?= Date: Fri, 19 Nov 2004 19:13:28 +0100 Content-Type: text/plain; charset="iso-8859-2"; Message-Id: <20041119181328.2C58638183@rekin11.go2.pl> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] VNC patch 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 Hello, I am working witch qemu rfb9 patch and I found it useful to specify=20 local port on wchich vnc server would listen. Here is a patch for=20 that.=20 Does anyone have a solution for mouse/vnc problems (calibration etc. )?? Apply it after rfb9 patch. diff -C4 qemu_cvs/vl.c qemu_cvs_mod/vl.c *** qemu_cvs/vl.c 2004-11-10 16:03:59.000000000 +0100 --- qemu_cvs_mod/vl.c 2004-11-17 12:17:31.433395968 +0100 *************** *** 112,119 **** --- 112,120 ---- int bios_size; static DisplayState display_state; int nographic; int usevnc; /* 1=3Dvnc only, 2=3Dvnc and sdl */ + int vnc_port; const char* keyboard_layout =3D 0; int64_t ticks_per_sec; int boot_device =3D 'c'; int ram_size; *************** *** 2504,2511 **** --- 2505,2513 ---- "-m megs set virtual RAM size to megs MB=20 [default=3D%d]\n" "-nographic disable graphical output and redirect=20 serial I/Os to console\n" #ifdef CONFIG_VNC "-vnc use vnc instead of sdl\n" + "-vnc_port set vnc listen port\n" #ifdef CONFIG_SDL "-vnc-and-sdl use vnc and sdl simultaneously\n" #endif #endif *************** *** 2600,2607 **** --- 2602,2610 ---- QEMU_OPTION_m, QEMU_OPTION_nographic, #ifdef CONFIG_VNC QEMU_OPTION_vnc, + QEMU_OPTION_vnc_port, #ifdef CONFIG_SDL QEMU_OPTION_vnc_and_sdl, #endif #endif *************** *** 2663,2670 **** --- 2666,2674 ---- { "m", HAS_ARG, QEMU_OPTION_m }, { "nographic", 0, QEMU_OPTION_nographic }, #ifdef CONFIG_VNC { "vnc", 0, QEMU_OPTION_vnc }, + { "vnc_port", HAS_ARG, QEMU_OPTION_vnc_port }, #ifdef CONFIG_SDL { "vnc-and-sdl", 0, QEMU_OPTION_vnc_and_sdl }, #endif #endif *************** *** 2807,2814 **** --- 2811,2819 ---- #endif snapshot =3D 0; nographic =3D 0; usevnc =3D 0; + vnc_port =3D -1; kernel_filename =3D NULL; kernel_cmdline =3D ""; has_cdrom =3D 1; cyls =3D heads =3D secs =3D 0; *************** *** 2903,2910 **** --- 2908,2922 ---- #ifdef CONFIG_VNC case QEMU_OPTION_vnc: usevnc =3D 1; break; + case QEMU_OPTION_vnc_port: + vnc_port =3D atoi(optarg); + if( vnc_port < 0 ) + { + fprintf(stderr,"qemu: invalid vnc port %s\n", optarg); + } + break; #ifdef CONFIG_SDL case QEMU_OPTION_vnc_and_sdl: usevnc =3D 2; break; *************** *** 3312,3320 **** dumb_display_init(ds); } else { if (usevnc) { #ifdef CONFIG_VNC ! vnc_display_init(ds, (usevnc=3D=3D2)); #else perror("qemu not configured with vnc support"); #endif } else { --- 3324,3332 ---- dumb_display_init(ds); } else { if (usevnc) { #ifdef CONFIG_VNC ! vnc_display_init(ds, (usevnc=3D=3D2), vnc_port); #else perror("qemu not configured with vnc support"); #endif } else { diff -C4 qemu_cvs/vl.h qemu_cvs_mod/vl.h *** qemu_cvs/vl.h 2004-11-10 16:04:00.000000000 +0100 --- qemu_cvs_mod/vl.h 2004-11-17 12:10:13.466976984 +0100 *************** *** 537,545 **** void vga_invalidate_display(void); void vga_screen_dump(const char *filename); =20 /* vnc.c */ ! void vnc_display_init(DisplayState *ds, int useAlsoSDL); =20 /* cirrus_vga.c */ void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t=20 *vga_ram_base,=20 unsigned long vga_ram_offset, int=20 vga_ram_size); --- 537,545 ---- void vga_invalidate_display(void); void vga_screen_dump(const char *filename); =20 /* vnc.c */ ! void vnc_display_init(DisplayState *ds, int useAlsoSDL, int=20 vncport); =20 /* cirrus_vga.c */ void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t=20 *vga_ram_base,=20 unsigned long vga_ram_offset, int=20 vga_ram_size); diff -C4 qemu_cvs/vnc.c qemu_cvs_mod/vnc.c *** qemu_cvs/vnc.c 2004-11-10 16:04:00.000000000 +0100 --- qemu_cvs_mod/vnc.c 2004-11-17 12:09:53.465017744 +0100 *************** *** 489,497 **** { rfbScreenCleanup(screen); } =20 ! void vnc_display_init(DisplayState *ds, int useAlsoSDL) { if(!keyboard_layout) { fprintf(stderr, "No keyboard language specified\n"); exit(1); --- 489,497 ---- { rfbScreenCleanup(screen); } =20 ! void vnc_display_init(DisplayState *ds, int useAlsoSDL, int=20 vncport) { if(!keyboard_layout) { fprintf(stderr, "No keyboard language specified\n"); exit(1); *************** *** 519,526 **** --- 519,529 ---- screen->serverFormat.redMax =3D 31; screen->serverFormat.greenMax =3D 63; screen->serverFormat.blueMax =3D 31; =20 + if( vncport > 0 ) + screen->port =3D vncport; +=20 if(useAlsoSDL) { ds_sdl=3D(DisplayState*)malloc(sizeof(DisplayState)); sdl_display_init(ds_sdl,0); screen->frameBuffer =3D ds_sdl->data; Is this the right way to do this? Peter Reiter