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.


Minor bug fixes and defensive programming
[palacios.git] / palacios / src / palacios / vm_guest.c
index 5c98848..9f7afe8 100644 (file)
@@ -250,6 +250,15 @@ int v3_init_vm(struct v3_vm_info * vm) {
        return -1;
     }
 
+    if (v3_init_passthrough_paging(vm) == -1) {
+        PrintError(vm, VCORE_NONE, "VM initialization error in passthrough paging\n");
+       return -1;
+    }
+
+    if (v3_init_nested_paging(vm) == -1) {
+        PrintError(vm, VCORE_NONE, "VM initialization error in nested paging\n");
+       return -1;
+    }
 
     v3_init_time_vm(vm);
 
@@ -333,8 +342,15 @@ int v3_free_vm_internal(struct v3_vm_info * vm) {
     v3_deinit_time_vm(vm);
 
     v3_deinit_mem_hooks(vm);
+
+#ifdef V3_CONFIG_SWAPPING
+    v3_deinit_swapping_vm(vm);
+#endif
+
     v3_delete_mem_map(vm);
     v3_deinit_shdw_impl(vm);
+    v3_deinit_passthrough_paging(vm);
+    v3_deinit_nested_paging(vm);
 
     v3_deinit_ext_manager(vm);
     v3_deinit_intr_routers(vm);
@@ -376,7 +392,11 @@ int v3_init_core(struct guest_info * core) {
 #endif
 
     if (core->shdw_pg_mode == SHADOW_PAGING) {
+        v3_init_passthrough_paging_core(core);
        v3_init_shdw_pg_state(core);
+    } else {
+        //done later due to SVM/VMX differences 
+        //v3_init_nested_paging_core(core);
     }
 
     v3_init_time_core(core);
@@ -441,6 +461,9 @@ int v3_free_core(struct guest_info * core) {
 
     if (core->shdw_pg_mode == SHADOW_PAGING) {
        v3_deinit_shdw_pg_state(core);
+        v3_deinit_passthrough_paging_core(core);
+   } else {
+        v3_deinit_nested_paging_core(core);
     }
 
     v3_free_passthrough_pts(core);