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.


Correct VM deallocation on fail before nested paging init
[palacios.git] / palacios / src / palacios / vmm_direct_paging.c
index 7c3e72f..716e029 100644 (file)
@@ -407,6 +407,7 @@ int v3_init_passthrough_paging(struct v3_vm_info *vm)
 {
   INIT_LIST_HEAD(&(vm->passthrough_impl.event_callback_list));
   v3_rw_lock_init(&(vm->passthrough_impl.event_callback_lock));
+  vm->passthrough_impl.inited=1;
   return 0;
 }
 
@@ -415,6 +416,10 @@ int v3_deinit_passthrough_paging(struct v3_vm_info *vm)
   struct passthrough_event_callback *cb,*temp;
   addr_t flags;
   
+  if (!vm->passthrough_impl.inited) { 
+      return 0;
+  }
+
   flags=v3_write_lock_irqsave(&(vm->passthrough_impl.event_callback_lock));
   
   list_for_each_entry_safe(cb,
@@ -619,6 +624,7 @@ int v3_init_nested_paging(struct v3_vm_info *vm)
 {
   INIT_LIST_HEAD(&(vm->nested_impl.event_callback_list));
   v3_rw_lock_init(&(vm->nested_impl.event_callback_lock));
+  vm->nested_impl.inited=1;
   return 0;
 }
 
@@ -639,6 +645,10 @@ int v3_deinit_nested_paging(struct v3_vm_info *vm)
   struct nested_event_callback *cb,*temp;
   addr_t flags;
   
+  if (!vm->nested_impl.inited) { 
+      return 0;
+  }
+
   flags=v3_write_lock_irqsave(&(vm->nested_impl.event_callback_lock));
     
   list_for_each_entry_safe(cb,