Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


cleaned up VM run states and added pause state
Jack Lange [Fri, 12 Aug 2011 15:16:42 +0000 (11:16 -0400)]
palacios/include/palacios/vmm_types.h
palacios/src/palacios/vmm.c

index 1a17997..8d45bcd 100644 (file)
@@ -27,7 +27,7 @@
 
 
 typedef enum {SHADOW_PAGING, NESTED_PAGING} v3_paging_mode_t;
-typedef enum {VM_RUNNING, VM_STOPPED, VM_SUSPENDED, VM_ERROR, VM_EMULATING} v3_vm_operating_mode_t;
+typedef enum {VM_RUNNING, VM_STOPPED, VM_PAUSED, VM_ERROR} v3_vm_operating_mode_t;
 typedef enum {CORE_RUNNING, CORE_STOPPED} v3_core_operating_mode_t;
 
 typedef enum {REAL, /*UNREAL,*/ PROTECTED, PROTECTED_PAE, LONG, LONG_32_COMPAT, LONG_16_COMPAT} v3_cpu_mode_t;
index 0597be1..9e0fe08 100644 (file)
@@ -413,19 +413,23 @@ int v3_pause_vm(struct v3_vm_info * vm) {
 
     while (v3_raise_barrier(vm, NULL) == -1);
 
+    vm->run_state = VM_PAUSED;
+
     return 0;
 }
 
 
 int v3_continue_vm(struct v3_vm_info * vm) {
 
-    if (vm->run_state != VM_RUNNING) {
-       PrintError("Tried to continue a VM that was not already running\n");
+    if (vm->run_state != VM_PAUSED) {
+       PrintError("Tried to continue a VM that was not paused\n");
        return -1;
     }
 
     v3_lower_barrier(vm);
 
+    vm->run_state = VM_RUNNING;
+
     return 0;
 }