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.


Remove Linux header file for newer version of Linux kernel
[palacios.git] / linux_module / main.c
index 9317635..b24df34 100644 (file)
@@ -5,6 +5,7 @@
 
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/errno.h>
 #include <linux/percpu.h>
 #include <linux/fs.h>
 
 MODULE_LICENSE("GPL");
 
+// Module parameter
+int cpu_list[NR_CPUS] = {};
+int cpu_list_len = 0;
+module_param_array(cpu_list, int, &cpu_list_len, 0644);
+MODULE_PARM_DESC(cpu_list, "Comma-delimited list of CPUs that Palacios will run on");
+
 int mod_allocs = 0;
 int mod_frees = 0;
 
@@ -61,7 +68,7 @@ static long v3_dev_ioctl(struct file * filp,
 
 
     switch (ioctl) {
-       case V3_START_GUEST:{
+       case V3_CREATE_GUEST:{
            int vm_minor = 0;
            struct v3_guest_img user_image;
            struct v3_guest * guest = kmalloc(sizeof(struct v3_guest), GFP_KERNEL);
@@ -73,7 +80,7 @@ static long v3_dev_ioctl(struct file * filp,
 
            memset(guest, 0, sizeof(struct v3_guest));
 
-           printk("Palacios: Starting V3 Guest...\n");
+           printk("Palacios: Creating V3 Guest...\n");
 
            vm_minor = register_vm(guest);
 
@@ -106,32 +113,23 @@ static long v3_dev_ioctl(struct file * filp,
 
            strncpy(guest->name, user_image.name, 127);
 
-           printk("Palacios: Launching VM\n");
-
            INIT_LIST_HEAD(&(guest->exts));
 
-           if (start_palacios_vm(guest) == -1) {
-               printk("Palacios: Error starting guest\n");
+           if (create_palacios_vm(guest) == -1) {
+               printk("Palacios: Error creating guest\n");
                return -EFAULT;
            }
 
-           return guest->vm_dev;
+           return vm_minor;
            break;
        }
-       case V3_STOP_GUEST: {
+       case V3_FREE_GUEST: {
            unsigned long vm_idx = arg;
            struct v3_guest * guest = guest_map[vm_idx];
 
-           printk("Stopping VM idx=%d\n", vm_idx);
-           printk("Stopping VM (%s) (%p)\n", guest->name, guest);
+           printk("Freeing VM (%s) (%p)\n", guest->name, guest);
 
-
-           if (irqs_disabled()) {
-               printk("WHAT!!?? IRQs are disabled??\n");
-               break;
-           }
-
-           stop_palacios_vm(guest);
+           free_palacios_vm(guest);
            guest_map[vm_idx] = NULL;
            break;
        }
@@ -180,9 +178,7 @@ static int __init v3_init(void) {
 
     palacios_init_mm();
 
-
     // Initialize Palacios
-    
     palacios_vmm_init();