Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Linux userspace tools for live migration
Diana Palsetia, Steve Rangel, and Mark Cartwright [Thu, 19 Jul 2012 23:24:51 +0000 (18:24 -0500)]
linux_usr/Makefile
linux_usr/v3_ctrl.h
linux_usr/v3_receive.c [new file with mode: 0644]
linux_usr/v3_send.c [new file with mode: 0644]

index f459a1e..5da0c44 100644 (file)
@@ -27,7 +27,9 @@ BASE_EXECS =  v3_mem \
                v3_stream \
                v3_monitor \
                 v3_hypercall \
-               v3_debug
+               v3_debug \
+               v3_send \
+               v3_receive \
 
 #
 # Examples
@@ -44,7 +46,7 @@ EXPERIMENTAL_EXECS =  v3_simulate  \
                        v3_inject_ecc_scrubber_mce  \
                         v3_top_inject \
                         v3_env_inject \
-                                               v3_syscall
+                       v3_syscall
 
 
 
index 97cb0fd..6522b34 100644 (file)
@@ -28,6 +28,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_usr/v3_receive.c b/linux_usr/v3_receive.c
new file mode 100644 (file)
index 0000000..9c3fafd
--- /dev/null
@@ -0,0 +1,71 @@
+/* 
+ * V3 checkpoint send (live-migration) utility
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h> 
+#include <sys/ioctl.h> 
+#include <sys/stat.h> 
+#include <sys/types.h> 
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <curses.h>
+
+
+#include "v3_ctrl.h"
+
+
+#define MAX_STORE_LEN 128
+#define MAX_URL_LEN 256
+
+
+struct v3_chkpt_info chkpt;
+
+int main(int argc, char* argv[]) {
+    int vm_fd;
+    char * vm_dev = NULL;
+
+    if (argc < 4) {
+       printf("Usage: ./v3_receive <vm_device> <store> <url>\n");
+       return -1;
+    }
+
+    vm_dev = argv[1];
+
+    if (strlen(argv[2]) >= MAX_STORE_LEN) {
+       printf("ERROR: Checkpoint store name longer than maximum size (%d)\n", MAX_STORE_LEN);
+       return -1;
+    }
+
+    strncpy(chkpt.store, argv[2], MAX_STORE_LEN);
+
+
+    if (strlen(argv[3]) >= MAX_URL_LEN) {
+       printf("ERROR: Checkpoint URL longer than maximum size (%d)\n", MAX_URL_LEN);
+       return -1;
+    }
+
+    strncpy(chkpt.url, argv[3], MAX_URL_LEN);
+
+    vm_fd = open(vm_dev, O_RDONLY);
+    if (vm_fd == -1) {
+       printf("Error opening VM device: %s\n", vm_dev);
+       return -1;
+    }
+
+    if (ioctl(vm_fd, V3_VM_RECEIVE, &chkpt)<0) { 
+       printf("VM reception failed\n");
+       return -1;
+    }
+    
+    /* Close the file descriptor.  */ 
+    close(vm_fd);
+    return 0; 
+}
diff --git a/linux_usr/v3_send.c b/linux_usr/v3_send.c
new file mode 100644 (file)
index 0000000..fcb71c4
--- /dev/null
@@ -0,0 +1,73 @@
+/* 
+ * V3 checkpoint send (live-migration) utility
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h> 
+#include <sys/ioctl.h> 
+#include <sys/stat.h> 
+#include <sys/types.h> 
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <errno.h>
+#include<linux/unistd.h>
+#include <curses.h>
+
+
+#include "v3_ctrl.h"
+
+
+#define MAX_STORE_LEN 128
+#define MAX_URL_LEN 256
+
+
+struct v3_chkpt_info chkpt;
+
+int main(int argc, char* argv[]) {
+    int vm_fd;
+    char * vm_dev = NULL;
+
+    if (argc < 4) {
+       printf("Usage: ./v3_send <vm_device> <store> <url>\n");
+       return -1;
+    }
+
+    vm_dev = argv[1];
+
+    if (strlen(argv[2]) >= MAX_STORE_LEN) {
+       printf("ERROR: Checkpoint store name longer than maximum size (%d)\n", MAX_STORE_LEN);
+       return -1;
+    }
+
+    strncpy(chkpt.store, argv[2], MAX_STORE_LEN);
+
+
+    if (strlen(argv[3]) >= MAX_URL_LEN) {
+       printf("ERROR: Checkpoint URL longer than maximum size (%d)\n", MAX_URL_LEN);
+       return -1;
+    }
+
+    strncpy(chkpt.url, argv[3], MAX_URL_LEN);
+
+    vm_fd = open(vm_dev, O_RDONLY);
+    if (vm_fd == -1) {
+       printf("Error opening VM device: %s\n", vm_dev);
+       return -1;
+    }
+
+    if (ioctl(vm_fd, V3_VM_SEND, &chkpt)<0) { 
+       printf("Error sending the VM\n");
+       return -1;
+    }
+
+    /* Close the file descriptor.  */ 
+    close(vm_fd);
+    return 0; 
+}
+
+