qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] VNC patch
@ 2004-11-19 18:13 Piotr R.
  2004-11-20  6:20 ` [Qemu-devel] Qemu code copy Shivkumar Shivaji
  0 siblings, 1 reply; 3+ messages in thread
From: Piotr R. @ 2004-11-19 18:13 UTC (permalink / raw)
  To: qemu-devel

Hello,

I am working witch qemu rfb9 patch and I found it useful to specify 
local port on wchich vnc server would listen. Here is a patch for 
that. 

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=vnc only, 2=vnc and sdl */
+ int vnc_port;
  const char* keyboard_layout = 0;
  int64_t ticks_per_sec;
  int boot_device = 'c';
  int ram_size;
***************
*** 2504,2511 ****
--- 2505,2513 ----
             "-m megs         set virtual RAM size to megs MB 
[default=%d]\n"
             "-nographic      disable graphical output and redirect 
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 = 0;
      nographic = 0;
      usevnc = 0;
+     vnc_port = -1;
      kernel_filename = NULL;
      kernel_cmdline = "";
      has_cdrom = 1;
      cyls = heads = secs = 0;
***************
*** 2903,2910 ****
--- 2908,2922 ----
  #ifdef CONFIG_VNC
  	    case QEMU_OPTION_vnc:
  		usevnc = 1;
  		break;
+ 	    case QEMU_OPTION_vnc_port:
+                 vnc_port = 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 = 2;
  		break;
***************
*** 3312,3320 ****
          dumb_display_init(ds);
      } else {
  	if (usevnc) {
  #ifdef CONFIG_VNC
! 	    vnc_display_init(ds, (usevnc==2));
  #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==2), 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);
  
  /* vnc.c */
! void vnc_display_init(DisplayState *ds, int useAlsoSDL);
  
  /* cirrus_vga.c */
  void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t 
*vga_ram_base, 
                           unsigned long vga_ram_offset, int 
vga_ram_size);
--- 537,545 ----
  void vga_invalidate_display(void);
  void vga_screen_dump(const char *filename);
  
  /* vnc.c */
! void vnc_display_init(DisplayState *ds, int useAlsoSDL, int 
vncport);
  
  /* cirrus_vga.c */
  void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t 
*vga_ram_base, 
                           unsigned long vga_ram_offset, int 
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);
  }
  
! void vnc_display_init(DisplayState *ds, int useAlsoSDL)
  {
  	if(!keyboard_layout) {
  		fprintf(stderr, "No keyboard language specified\n");
  		exit(1);
--- 489,497 ----
  {
  	rfbScreenCleanup(screen);
  }
  
! void vnc_display_init(DisplayState *ds, int useAlsoSDL, int 
vncport)
  {
  	if(!keyboard_layout) {
  		fprintf(stderr, "No keyboard language specified\n");
  		exit(1);
***************
*** 519,526 ****
--- 519,529 ----
  	screen->serverFormat.redMax = 31;
  	screen->serverFormat.greenMax = 63;
  	screen->serverFormat.blueMax = 31;
  
+ 	if( vncport > 0 )
+ 	    screen->port = vncport;
+ 
  	if(useAlsoSDL) {
  		ds_sdl=(DisplayState*)malloc(sizeof(DisplayState));
  		sdl_display_init(ds_sdl,0);
  		screen->frameBuffer = ds_sdl->data;


Is this the right way to do this?

Peter Reiter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Qemu code copy
  2004-11-19 18:13 [Qemu-devel] VNC patch Piotr R.
@ 2004-11-20  6:20 ` Shivkumar Shivaji
  2004-11-21 11:01   ` Piotras
  0 siblings, 1 reply; 3+ messages in thread
From: Shivkumar Shivaji @ 2004-11-20  6:20 UTC (permalink / raw)
  To: qemu-devel

Is there anything preventing qemu regular (not qemu-fast) from using 
code-copy? Currently, code copy only works on hard mmu. Is there a way 
to enable it on the regular qemu?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Qemu code copy
  2004-11-20  6:20 ` [Qemu-devel] Qemu code copy Shivkumar Shivaji
@ 2004-11-21 11:01   ` Piotras
  0 siblings, 0 replies; 3+ messages in thread
From: Piotras @ 2004-11-21 11:01 UTC (permalink / raw)
  To: qemu-devel

Hi!

Code copy works by executing original code blocks (no translation 
is performed) when possible. If the block contains memory access 
instruction, it can be executed in code-copy mode only when virtual 
memory of emulated CPU is visible as qemu process virtual memory. 
This is what qemu-fast does with mmap.

I think that in practice nearly all code blocks contain memory access 
instructions. If so, it's not worth to enable code-copy for qemu-soft.

Probably it's possible to build simple code translator that would 
translate only memory access instructions and execute most of 
the other instructions natively.


Regards,

Piotrek

On Fri, 19 Nov 2004 22:20:05 -0800, Shivkumar Shivaji
<shivdev@chesstrain.com> wrote:
> Is there anything preventing qemu regular (not qemu-fast) from using
> code-copy? Currently, code copy only works on hard mmu. Is there a way
> to enable it on the regular qemu?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-21 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19 18:13 [Qemu-devel] VNC patch Piotr R.
2004-11-20  6:20 ` [Qemu-devel] Qemu code copy Shivkumar Shivaji
2004-11-21 11:01   ` Piotras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).