X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-vm.c;h=29cafd7554ec0d5e6e8d25d30260bcf5975e0004;hb=9d406e84682878859284200ae00251d27c53c845;hp=943bbff17c2ea77e020fe355e99975e2b0d7f3a5;hpb=374b2d6d22a0e0dc6ed8d3d628e635ab935072e0;p=palacios.releases.git diff --git a/linux_module/palacios-vm.c b/linux_module/palacios-vm.c index 943bbff..29cafd7 100644 --- a/linux_module/palacios-vm.c +++ b/linux_module/palacios-vm.c @@ -17,25 +17,31 @@ #include #include -#ifdef CONFIG_DEBUG_FS -#include -#endif #include #include "palacios.h" -#include "palacios-console.h" -#include "palacios-serial.h" #include "palacios-vm.h" +#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" +#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) { - void __user * argp = (void __user *)arg; - char path_name[STREAM_NAME_LEN]; struct v3_guest * guest = filp->private_data; @@ -43,24 +49,39 @@ static long v3_vm_ioctl(struct file * filp, switch (ioctl) { + case V3_VM_STOP: { + printk("Stopping VM\n"); + stop_palacios_vm(guest); + 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_SERIAL_CONNECT: { + 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("copy from user error getting guest image...\n"); + printk("%s(%d): copy from user error...\n", __FILE__, __LINE__); return -EFAULT; } - return open_serial(path_name); - break; - } - case V3_VM_STOP: { - printk("Stopping VM\n"); - stop_palacios_vm(guest); + return open_stream(path_name); +#else + printk("Stream support Not available\n"); + return -EFAULT; +#endif break; } + default: printk("\tUnhandled\n"); return -EINVAL; @@ -106,8 +127,6 @@ extern u32 pg_frees; extern u32 mallocs; extern u32 frees; -#include - int start_palacios_vm(void * arg) { struct v3_guest * guest = (struct v3_guest *)arg; int err; @@ -152,32 +171,8 @@ int start_palacios_vm(void * arg) { -#if 0 - // Inspection Test - { - struct v3_inspection_value rax; - v3_inspect_node_t * core = NULL; - v3_inspect_node_t * gprs = NULL; - v3_inspect_node_t * root = v3_get_inspection_root(guest->v3_ctx); - - if (!root) { - printk("NULL root inspection tree\n"); - } - - core = v3_get_inspection_subtree(root, "core.0"); - if (!core) { - printk("NULL core inspection tree\n"); - } - - gprs = v3_get_inspection_subtree(core, "GPRS"); - if (!gprs) { - printk("NULL gprs inspection tree\n"); - } - - v3_get_inspection_value(gprs, "RAX", &rax); - - debugfs_create_u64("RAX", 0644, NULL, (u64 *)rax.value); - } +#if V3_CONFIG_EXT_INSPECTOR + inspect_vm(guest); #endif