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.


Paranoid error checking in userspace utils
[palacios.git] / linux_usr / v3_ctrl.c
index c8bf216..984045b 100644 (file)
@@ -28,7 +28,7 @@ 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_ctrl <guest_img> <vm name>\n");
        return -1;
     }
 
@@ -51,6 +51,10 @@ 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);