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.


More extensive error checking in checkpoint/restore + other cleanup
[palacios.git] / palacios / src / palacios / vmx.c
index 8d13c11..649181b 100644 (file)
@@ -643,8 +643,11 @@ int v3_vmx_save_core(struct guest_info * core, void * ctx){
     struct vmx_data * vmx_info = (struct vmx_data *)(core->vmm_data);
 
     // note that the vmcs pointer is an HPA, but we need an HVA
-    v3_chkpt_save(ctx, "vmcs_data", PAGE_SIZE_4KB, V3_VAddr((void*)
-                                                           (vmx_info->vmcs_ptr_phys)));
+    if (v3_chkpt_save(ctx, "vmcs_data", PAGE_SIZE_4KB, 
+                     V3_VAddr((void*) (vmx_info->vmcs_ptr_phys))) ==-1) {
+       PrintError("Could not save vmcs data for VMX\n");
+       return -1;
+    }
 
     return 0;
 }
@@ -655,8 +658,17 @@ int v3_vmx_load_core(struct guest_info * core, void * ctx){
     addr_t vmcs_page_paddr;  //HPA
 
     vmcs_page_paddr = (addr_t) V3_AllocPages(1);
+    
+    if (!vmcs_page_paddr) { 
+       PrintError("Could not allocate space for a vmcs in VMX\n");
+       return -1;
+    }
 
-    v3_chkpt_load(ctx, "vmcs_data", PAGE_SIZE_4KB, V3_VAddr((void *)vmcs_page_paddr));
+    if (v3_chkpt_load(ctx, "vmcs_data", PAGE_SIZE_4KB, 
+                     V3_VAddr((void *)vmcs_page_paddr)) == -1) { 
+       PrintError("Could not load vmcs data for VMX\n");
+       return -1;
+    }
 
     vmcs_clear(vmx_info->vmcs_ptr_phys);