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.


Revised check for already-launched VM
[palacios.git] / linux_usr / v3_create.c
index a73297f..3605702 100644 (file)
@@ -29,11 +29,11 @@ int main(int argc, char* argv[]) {
     memset(&guest_img, 0, sizeof(struct v3_guest_img));
 
     if (argc <= 2) {
-       printf("Usage: ./v3_ctrl <guest_img> <vm name>\n");
+       printf("usage: v3_create <guest_img> <vm name>\n");
        return -1;
     }
 
-    printf("Launching guest: %s\n", filename);
+    printf("Creating guest: %s\n", filename);
 
     guest_fd = open(filename, O_RDONLY); 
 
@@ -52,12 +52,16 @@ int main(int argc, char* argv[]) {
     
     // load guest image into user memory
     guest_img.guest_data = malloc(guest_img.size);
+    if (!guest_img.guest_data) {
+            printf("ERROR: could not allocate memory for guest image\n");
+            return -1;
+    }
 
     read_file(guest_fd, guest_img.size, guest_img.guest_data);
     
     close(guest_fd);
 
-    printf("Loaded guest image. Launching to V3Vee\n");
+    printf("Loaded guest image. Creation begins.\n");
     
     strncpy(guest_img.name, name, 127);