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.


make v3_launch fail on ioctl error
[palacios.git] / linux_usr / v3_launch.c
1 /* 
2  * V3 Control utility
3  * (c) Jack lange, 2010
4  */
5
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <fcntl.h> 
10 #include <sys/ioctl.h> 
11 #include <sys/stat.h> 
12 #include <sys/types.h> 
13 #include <unistd.h> 
14 #include <string.h>
15  
16 #include "v3_ctrl.h"
17
18 int main(int argc, char* argv[]) {
19     int vm_fd = 0;
20     char * filename = argv[1];
21     int err;
22
23     if (argc <= 1) {
24         printf("usage: v3_launch <vm-device>\n");
25         return -1;
26     }
27
28     printf("Launching VM (%s)\n", filename);
29     
30     vm_fd = open(filename, O_RDONLY);
31
32     if (vm_fd == -1) {
33         printf("Error opening V3Vee VM device\n");
34         return -1;
35     }
36
37     err = ioctl(vm_fd, V3_VM_LAUNCH, NULL); 
38     if (err < 0) {
39         printf("Error launching VM\n");
40         return -1;
41     }
42
43
44
45
46     /* Close the file descriptor.  */ 
47     close(vm_fd); 
48  
49
50
51     return 0; 
52
53
54