From: Diana Palsetia, Steve Rangel, and Mark Cartwright Date: Thu, 19 Jul 2012 21:36:43 +0000 (-0500) Subject: Linux-side availability of live migration functionality X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b9f54d875c87a0b06337fb64239278d6cfc02fa;p=palacios.git Linux-side availability of live migration functionality --- diff --git a/linux_module/palacios.h b/linux_module/palacios.h index 43ffa57..fd5a188 100644 --- a/linux_module/palacios.h +++ b/linux_module/palacios.h @@ -31,6 +31,9 @@ #define V3_VM_MOVE_CORE 33 +#define V3_VM_SEND 34 +#define V3_VM_RECEIVE 35 + #define V3_VM_FB_INPUT 257 #define V3_VM_FB_QUERY 258 diff --git a/linux_module/vm.c b/linux_module/vm.c index 1e9b275..b14cff4 100644 --- a/linux_module/vm.c +++ b/linux_module/vm.c @@ -209,6 +209,53 @@ static long v3_vm_ioctl(struct file * filp, break; } #endif + +#ifdef V3_CONFIG_LIVE_MIGRATION + case V3_VM_SEND: { + struct v3_chkpt_info chkpt_info; + void __user * argp = (void __user *)arg; + + memset(&chkpt_info,0, sizeof(struct v3_chkpt_info)); + + if(copy_from_user(&chkpt_info, argp, sizeof(struct v3_chkpt_info))){ + WARNING("Copy from user error getting checkpoint info\n"); + return -EFAULT; + } + + + NOTICE("Sending (live-migrating) Guest to %s:%s\n",chkpt_info.store, chkpt_info.url); + + if (v3_send_vm(guest->v3_ctx, chkpt_info.store, chkpt_info.url) == -1) { + WARNING("Error sending VM\n"); + return -EFAULT; + } + + break; + } + + case V3_VM_RECEIVE: { + struct v3_chkpt_info chkpt_info; + void __user * argp = (void __user *)arg; + + memset(&chkpt_info,0, sizeof(struct v3_chkpt_info)); + + if(copy_from_user(&chkpt_info, argp, sizeof(struct v3_chkpt_info))){ + WARNING("Copy from user error getting checkpoint info\n"); + return -EFAULT; + } + + + NOTICE("Receiving (live-migrating) Guest to %s:%s\n",chkpt_info.store, chkpt_info.url); + + if (v3_receive_vm(guest->v3_ctx, chkpt_info.store, chkpt_info.url) == -1) { + WARNING("Error receiving VM\n"); + return -EFAULT; + } + + break; + } +#endif + case V3_VM_DEBUG: { struct v3_debug_cmd cmd; struct v3_debug_event evt;