X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_save.c;h=4749c5a96c7deb7eab934050d821ef1665b712e3;hb=2cb41f7db5b9f89113432d6b3daff4807ba8e5f2;hp=46ae513e22351adfee0e6e7d936d8bc48a2de06c;hpb=035ac752dc4e0eda744205896a9c7c92689bea42;p=palacios.git diff --git a/linux_usr/v3_save.c b/linux_usr/v3_save.c index 46ae513..4749c5a 100644 --- a/linux_usr/v3_save.c +++ b/linux_usr/v3_save.c @@ -31,8 +31,16 @@ int main(int argc, char* argv[]) { int vm_fd; char * vm_dev = NULL; + + if (argc < 4) { - printf("usage: v3_save \n"); + printf("usage: v3_save [optionmask]\n"); + printf(" optionmask consists of the sum of any of the following\n"); + printf(" 0 none\n"); + printf(" 1 skip memory\n"); + printf(" 2 skip devices\n"); + printf(" 4 skip cores\n"); + printf(" 8 skip architecture-specific core state\n"); return -1; } @@ -45,7 +53,6 @@ int main(int argc, char* argv[]) { 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; @@ -53,6 +60,13 @@ int main(int argc, char* argv[]) { strncpy(chkpt.url, argv[3], MAX_URL_LEN); + if (argc>4) { + chkpt.opts = atoll(argv[4]); + } else { + chkpt.opts = V3_CHKPT_OPT_NONE; + } + + vm_fd = open(vm_dev, O_RDONLY); if (vm_fd == -1) { printf("Error opening VM device: %s\n", vm_dev);