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.


added state checks for VM control commands
Jack Lange [Fri, 27 Jul 2012 19:04:38 +0000 (15:04 -0400)]
palacios/src/palacios/vmm.c

index 18871b0..1d8cd07 100644 (file)
@@ -457,6 +457,12 @@ int v3_move_vm_core(struct v3_vm_info * vm, int vcore_id, int target_cpu) {
 
 int v3_stop_vm(struct v3_vm_info * vm) {
 
+    if ((vm->run_state |= VM_RUNNING) && 
+       (vm->run_state != VM_SIMULATING)) {
+       PrintError("Tried to stop VM in invalid runstate (%d)\n", vm->run_state);
+       return -1;
+    }
+
     vm->run_state = VM_STOPPED;
 
     // Sanity check to catch any weird execution states
@@ -649,6 +655,12 @@ int v3_free_vm(struct v3_vm_info * vm) {
     int i = 0;
     // deinitialize guest (free memory, etc...)
 
+    if ((vm->run_state != VM_STOPPED) &&
+       (vm->run_state != VM_ERROR)) {
+       PrintError("Tried to Free VM in invalid runstate (%d)\n", vm->run_state);
+       return -1;
+    }
+
     v3_free_vm_devices(vm);
 
     // free cores