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.


ported streams over to new extension framework
[palacios.git] / linux_module / palacios-vm.c
index a434f17..b50714e 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "palacios.h"
 #include "palacios-vm.h"
+#include "linux-exts.h"
 
 
 struct vm_ctrl {
@@ -111,13 +112,6 @@ static struct vm_ctrl * get_ctrl(struct v3_guest * guest, unsigned int cmd) {
 }
 
 
-#ifdef V3_CONFIG_STREAM
-#include "palacios-stream.h"
-#endif
-
-#ifdef V3_CONFIG_CONSOLE
-#include "palacios-console.h"
-#endif
 
 #ifdef V3_CONFIG_EXT_INSPECTOR
 #include "palacios-inspector.h"
@@ -129,10 +123,11 @@ static struct vm_ctrl * get_ctrl(struct v3_guest * guest, unsigned int cmd) {
 
 #ifdef V3_CONFIG_HOST_DEVICE
 #include "palacios-host-dev.h"
+#define HOST_DEV_URL_LEN 256
 #endif
 
 extern struct class * v3_class;
-#define STREAM_NAME_LEN 128
+
 
 static long v3_vm_ioctl(struct file * filp,
                        unsigned int ioctl, unsigned long arg) {
@@ -149,36 +144,13 @@ static long v3_vm_ioctl(struct file * filp,
            break;
        }
 
-       case V3_VM_CONSOLE_CONNECT: {
-#ifdef V3_CONFIG_CONSOLE
-           return connect_console(guest);
-#else
-           printk("Console support not available\n");
-           return -EFAULT;
-#endif
-           break;
-       }
-
-       case V3_VM_STREAM_CONNECT: {
-#ifdef V3_CONFIG_STREAM
-           void __user * argp = (void __user *)arg;
-           char path_name[STREAM_NAME_LEN];
-
-           if (copy_from_user(path_name, argp, STREAM_NAME_LEN)) {
-               printk("%s(%d): copy from user error...\n", __FILE__, __LINE__);
-               return -EFAULT;
-           }
 
-           return open_stream(path_name);
-#else
-           printk("Stream support Not available\n");
-           return -EFAULT;
-#endif
-           break;
-       }
 
        case V3_VM_HOST_DEV_CONNECT: {
-#ifdef V3_CONFIG_HOST_DEV
+#ifdef V3_CONFIG_HOST_DEVICE
+           void __user * argp = (void __user *)arg;
+           char host_dev_url[HOST_DEV_URL_LEN];
+
            if (copy_from_user(host_dev_url, argp, HOST_DEV_URL_LEN)) {
                printk("copy from user error getting url for host device connect...\n");
                return -EFAULT;
@@ -256,7 +228,6 @@ static struct file_operations v3_vm_fops = {
 };
 
 
-extern int vm_running;
 extern u32 pg_allocs;
 extern u32 pg_frees;
 extern u32 mallocs;
@@ -271,6 +242,7 @@ int start_palacios_vm(void * arg)  {
     // allow_signal(SIGKILL);
     unlock_kernel();
     
+    init_vm_extensions(guest);
 
     guest->v3_ctx = v3_create_vm(guest->img, (void *)guest, guest->name);
 
@@ -281,6 +253,8 @@ int start_palacios_vm(void * arg)  {
     }
 
     // init linux extensions
+    
+
 #ifdef V3_CONFIG_EXT_INSPECTOR
     inspect_vm(guest);
 #endif
@@ -315,10 +289,6 @@ int start_palacios_vm(void * arg)  {
 
     printk("palacios: launching vm\n");
 
-
-
-
-
     if (v3_start_vm(guest->v3_ctx, 0xffffffff) < 0) { 
        printk("palacios: launch of vm failed\n");
        device_destroy(v3_class, guest->vm_dev);