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);
// 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);