From: Jack Lange Date: Fri, 12 Aug 2011 15:16:42 +0000 (-0400) Subject: cleaned up VM run states and added pause state X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3499bda1c87722b48972e5b3a7e6f57217d85ce;hp=003f6285e6a34e02715764ab6eeb7aec01740341;p=palacios.git cleaned up VM run states and added pause state --- diff --git a/palacios/include/palacios/vmm_types.h b/palacios/include/palacios/vmm_types.h index 1a17997..8d45bcd 100644 --- a/palacios/include/palacios/vmm_types.h +++ b/palacios/include/palacios/vmm_types.h @@ -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; diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 0597be1..9e0fe08 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -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; }