direct-io.hg

changeset 8338:82f1b5364f94

Add an option for device model to disable key repeat.
On slow network, when creating a vmx guest remotely,
the key repeat feature may make it hard to even type
the user name and password to login in to guest OS.

Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Dec 13 17:01:09 2005 +0100 (2005-12-13)
parents ef2fff896422
children 494243ba43b8
files tools/ioemu/sdl.c tools/ioemu/vl.c tools/ioemu/vl.h
line diff
     1.1 --- a/tools/ioemu/sdl.c	Tue Dec 13 10:57:18 2005 +0000
     1.2 +++ b/tools/ioemu/sdl.c	Tue Dec 13 17:01:09 2005 +0100
     1.3 @@ -592,7 +592,8 @@ void sdl_display_init(DisplayState *ds, 
     1.4  
     1.5      sdl_resize(ds, 640, 400);
     1.6      sdl_update_caption();
     1.7 -    SDL_EnableKeyRepeat(250, 50);
     1.8 +    if(repeat_key)
     1.9 +        SDL_EnableKeyRepeat(250, 50);
    1.10      SDL_EnableUNICODE(1);
    1.11      gui_grab = 0;
    1.12  
     2.1 --- a/tools/ioemu/vl.c	Tue Dec 13 10:57:18 2005 +0000
     2.2 +++ b/tools/ioemu/vl.c	Tue Dec 13 17:01:09 2005 +0100
     2.3 @@ -145,6 +145,7 @@ int graphic_width = 800;
     2.4  int graphic_height = 600;
     2.5  int graphic_depth = 15;
     2.6  int full_screen = 0;
     2.7 +int repeat_key = 1;
     2.8  TextConsole *vga_console;
     2.9  CharDriverState *serial_hds[MAX_SERIAL_PORTS];
    2.10  int xc_handle;
    2.11 @@ -2250,6 +2251,7 @@ void help(void)
    2.12             "-std-vga        simulate a standard VGA card with VESA Bochs Extensions\n"
    2.13             "                (default is CL-GD5446 PCI VGA)\n"
    2.14             "-vgaacc [0|1]   1 to accelerate CL-GD5446 speed, default is 1\n"
    2.15 +           "-no-repeatkey   disable key repeat feature for SDL keyboard simulation"
    2.16  #endif
    2.17             "-loadvm file    start right away with a saved state (loadvm in monitor)\n"
    2.18             "\n"
    2.19 @@ -2342,6 +2344,7 @@ enum {
    2.20      QEMU_OPTION_loadvm,
    2.21      QEMU_OPTION_full_screen,
    2.22      QEMU_OPTION_vgaacc,
    2.23 +    QEMU_OPTION_repeatkey,
    2.24  };
    2.25  
    2.26  typedef struct QEMUOption {
    2.27 @@ -2421,6 +2424,7 @@ const QEMUOption qemu_options[] = {
    2.28      { "nic-ne2000", 0, QEMU_OPTION_nic_ne2000 },
    2.29      { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
    2.30      { "vgaacc", HAS_ARG, QEMU_OPTION_vgaacc },
    2.31 +    { "no-repeatkey", 0, QEMU_OPTION_repeatkey },
    2.32      { NULL },
    2.33  };
    2.34  
    2.35 @@ -2976,6 +2980,9 @@ int main(int argc, char **argv)
    2.36                      }
    2.37                  }
    2.38                  break;
    2.39 +            case QEMU_OPTION_repeatkey:
    2.40 +                repeat_key = 0;
    2.41 +                break;
    2.42              case QEMU_OPTION_std_vga:
    2.43                  cirrus_vga_enabled = 0;
    2.44                  break;
     3.1 --- a/tools/ioemu/vl.h	Tue Dec 13 10:57:18 2005 +0000
     3.2 +++ b/tools/ioemu/vl.h	Tue Dec 13 17:01:09 2005 +0100
     3.3 @@ -612,6 +612,7 @@ void pci_pcnet_init(PCIBus *bus, NetDriv
     3.4  
     3.5  void kbd_init(void);
     3.6  extern const char* keyboard_layout;
     3.7 +extern int repeat_key;
     3.8  
     3.9  /* mc146818rtc.c */
    3.10