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.


Memory management enhancements: dynamic removal, cleanup at module remove time
[palacios.git] / linux_module / main.c
index caaca4f..425e08f 100644 (file)
@@ -197,8 +197,31 @@ out_err:
            break;
        }
 
+       case V3_REMOVE_MEMORY: {
+           struct v3_mem_region mem;
+           
+           memset(&mem, 0, sizeof(struct v3_mem_region));
+           
+           if (copy_from_user(&mem, argp, sizeof(struct v3_mem_region))) {
+               ERROR("copy from user error getting mem_region...\n");
+               return -EFAULT;
+           }
+
+           DEBUG("Removing memory at address %p\n", (void*)(mem.base_addr));
+
+           if (remove_palacios_memory(&mem) == -1) {
+               ERROR("Error removing memory from Palacios\n");
+               return -EFAULT;
+           }
+
+           break;
+       }
+           
+           
+
         case V3_RESET_MEMORY: {
-            if (palacios_init_mm() == -1) {
+           DEBUG("Resetting memory\n");
+            if (palacios_deinit_mm() == -1) {
                 ERROR("Error resetting Palacios memory\n");
                 return -EFAULT;
             }