X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fvm.c;h=06a016aba3ecf4b6d3da72d389e01eb812006a07;hb=c6376e3af2c48a2ec22e8521a3f96fa7923bf264;hp=88e3befc4d8fc7d5a9eb2d46709cd72ec59a1da6;hpb=791ea2f3e21cfbc9c47341efbb98995c33d86fcb;p=palacios.git diff --git a/linux_module/vm.c b/linux_module/vm.c index 88e3bef..06a016a 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))) { + ERROR("Error: Could not copy debug command from user space\n"); + return -EFAULT; + } + + evt.core_id = cmd.core; + evt.cmd = cmd.cmd; + + INFO("Debugging VM\n"); + + if (v3_deliver_debug_event(guest->v3_ctx, &evt) == -1) { + ERROR("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;