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.


userspace changes to break apart VM lifecycle management
[palacios.git] / linux_usr / v3_stop.c
index 061cd28..a5f3249 100644 (file)
  
 #include "v3_ctrl.h"
 
-int read_file(int fd, int size, unsigned char * buf);
-
 int main(int argc, char* argv[]) {
     int vm_fd = 0;
-    unsigned long vm_idx = 0;
-
+    char * filename = argv[1];
 
     if (argc <= 1) {
-       printf("Usage: ./v3_stop <vm-dev-idx>\n");
+       printf("Usage: ./v3_stop <vm-device>\n");
        return -1;
     }
 
-
-    vm_idx = atoi(argv[1]);
-
-    printf("Stopping VM\n");
+    printf("Stopping VM (%s)\n", filename);
     
-    vm_fd = open("/dev/v3vee", O_RDONLY);
+    vm_fd = open(filename, O_RDONLY);
 
     if (vm_fd == -1) {
        printf("Error opening V3Vee VM device\n");
        return -1;
     }
 
-    ioctl(vm_fd, V3_STOP_GUEST, vm_idx); 
+    ioctl(vm_fd, V3_VM_STOP, NULL);