IMO, it would be faster if we provide keyboard shortcuts that will
stop and resume VM execution right from SDL guest interface, rather
than switching to console monitor first and type "s" or "c"
respectively.

Note: I simply skip checking the keys in encrypted block devices when
resuming the VM. Not sure whether we really need it or not.

Signed-off-by: Mulyadi Santosa <mulyadi.sant...@gmail.com>

sdl.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- sdl.c.bak   2009-08-02 16:00:28.000000000 +0700
+++ sdl.c       2009-10-18 22:53:59.000000000 +0700
@@ -440,6 +440,7 @@ static void sdl_refresh(DisplayState *ds
                 if (gui_key_modifier_pressed) {
                     int keycode;
                     keycode = sdl_keyevent_to_keycode(&ev->key);
+                    //fprintf(stderr,"scan code of key pressed is
%d\n",keycode);
                     switch(keycode) {
                     case 0x21: /* 'f' key on US keyboard */
                         toggle_full_screen(ds);
@@ -456,6 +457,14 @@ static void sdl_refresh(DisplayState *ds
                         }
                         gui_keysym = 1;
                         break;
+                    case 0x1f: /* 's' key -- stopping VM */
+                        vm_stop(16); /* 16 is EXCP_INTERRUPT */
+                        gui_keysym = 1;
+                        break;
+                    case 0x2e: /* 'c' key -- resuming VM */
+                        vm_start(); /* we skip checking encrypted
block drive */
+                        gui_keysym = 1;
+                        break;
                     default:
                         break;
                     }


Reply via email to