X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fvm.c;h=f53a5985f74bc812ee2635d7f9e3403d059355b3;hb=47f2237e5c6a71a63f04bc3dc0215fbbe2f40490;hp=852733c734e03d82abd43f5b8fc32c10c8f19e6d;hpb=276cfa264720edddc1677e35c6a300596965de7d;p=palacios.releases.git diff --git a/linux_module/vm.c b/linux_module/vm.c index 852733c..f53a598 100644 --- a/linux_module/vm.c +++ b/linux_module/vm.c @@ -12,7 +12,7 @@ #include #include #include - +#include #include #include #include @@ -129,10 +129,36 @@ static long v3_vm_ioctl(struct file * filp, switch (ioctl) { case V3_VM_STOP: { - printk("Stopping VM\n"); + printk("Stopping VM (%s)\n", guest->name); stop_palacios_vm(guest); break; } + case V3_VM_PAUSE: { + printk("Pausing VM (%s)\n", guest->name); + v3_pause_vm(guest->v3_ctx); + break; + } + case V3_VM_CONTINUE: { + printk("Continuing VM (%s)\n", guest->name); + v3_continue_vm(guest->v3_ctx); + break; + } + case V3_VM_MOVE_CORE: { + struct v3_core_move_cmd cmd; + void __user * argp = (void __user *)arg; + + memset(&cmd, 0, sizeof(struct v3_core_move_cmd)); + + if (copy_from_user(&cmd, argp, sizeof(struct v3_core_move_cmd))) { + printk("copy from user error getting migrate command...\n"); + return -EFAULT; + } + + printk("moving guest %s vcore %d to CPU %d\n", guest->name, cmd.vcore_id, cmd.pcore_id); + + v3_move_vm_core(guest->v3_ctx, cmd.vcore_id, cmd.pcore_id); + } + break; default: { struct vm_ctrl * ctrl = get_ctrl(guest, ioctl); @@ -264,7 +290,7 @@ int stop_palacios_vm(struct v3_guest * guest) { cdev_del(&(guest->cdev)); - kfree(guest->img); + vfree(guest->img); kfree(guest); return 0;