X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fvm.c;h=40cfa0621ca9e00592562c7ac71fbd3315404e19;hb=e784113618800cede961f9a86084a96d20179e1c;hp=88e3befc4d8fc7d5a9eb2d46709cd72ec59a1da6;hpb=2501786527fbddda7b8d2ef7218b683b6e21ca83;p=palacios.git diff --git a/linux_module/vm.c b/linux_module/vm.c index 88e3bef..40cfa06 100644 --- a/linux_module/vm.c +++ b/linux_module/vm.c @@ -19,6 +19,7 @@ #include #include +#include #include "palacios.h" #include "vm.h" @@ -208,6 +209,30 @@ static long v3_vm_ioctl(struct file * filp, break; } #endif + case V3_VM_DEBUG: { + struct v3_debug_cmd cmd; + struct v3_debug_event evt; + void __user * argp = (void __user *)arg; + + memset(&cmd, 0, sizeof(struct v3_debug_cmd)); + + if (copy_from_user(&cmd, argp, sizeof(struct v3_debug_cmd))) { + printk("Error: Could not copy debug command from user space\n"); + return -EFAULT; + } + + evt.core_id = cmd.core; + evt.cmd = cmd.cmd; + + printk("Debugging VM\n"); + + if (v3_deliver_debug_event(guest->v3_ctx, &evt) == -1) { + printk("Error could not deliver debug cmd\n"); + return -EFAULT; + } + + break; + } case V3_VM_MOVE_CORE: { struct v3_core_move_cmd cmd; void __user * argp = (void __user *)arg;