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.


Deallocation bug fix in device manager to allow backing out from VM creation failure
[palacios.git] / linux_usr / v3_launch.c
index 7419a6b..217d104 100644 (file)
@@ -3,52 +3,16 @@
  * (c) Jack lange, 2010
  */
 
-
-#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 "v3_ctrl.h"
 
 int main(int argc, char* argv[]) {
-    int vm_fd = 0;
     char * filename = argv[1];
-    int err;
-
-    if (argc <= 1) {
-       printf("usage: v3_launch <vm-device>\n");
-       return -1;
-    }
-
-    printf("Launching VM (%s)\n", filename);
-    
-    vm_fd = open(filename, O_RDONLY);
-
-    if (vm_fd == -1) {
-       printf("Error opening V3Vee VM device\n");
-       return -1;
-    }
-
-    err = ioctl(vm_fd, V3_VM_LAUNCH, NULL); 
-    if (err < 0) {
-        printf("Error launching VM\n");
-        return -1;
-    }
 
+    if (argc <= 1) 
+       v3_usage("<vm-device>\n");
 
 
-
-    /* Close the file descriptor.  */ 
-    close(vm_fd); 
-
+    launch_vm(filename);
 
     return 0; 
 } 
-
-