2 * V3 checkpoint save utility
11 #include <sys/types.h>
17 #include<linux/unistd.h>
24 #define MAX_STORE_LEN 128
25 #define MAX_URL_LEN 256
28 struct v3_chkpt_info chkpt;
30 int main(int argc, char* argv[]) {
35 printf("Usage: ./v3_load <vm_device> <store> <url>\n");
41 if (strlen(argv[2]) >= MAX_STORE_LEN) {
42 printf("ERROR: Checkpoint store name longer than maximum size (%d)\n", MAX_STORE_LEN);
46 strncpy(chkpt.store, argv[2], MAX_STORE_LEN);
49 if (strlen(argv[3]) >= MAX_URL_LEN) {
50 printf("ERROR: Checkpoint URL longer than maximum size (%d)\n", MAX_URL_LEN);
54 strncpy(chkpt.url, argv[3], MAX_URL_LEN);
56 vm_fd = open(vm_dev, O_RDONLY);
58 printf("Error opening VM device: %s\n", vm_dev);
62 ioctl(vm_fd, V3_VM_LOAD, &chkpt);
64 /* Close the file descriptor. */