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.


Linux user updates for more recent distros (Ubuntu 14.04 as target)
[palacios.git] / linux_usr / v3_simulate.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
19 int main(int argc, char* argv[]) {
20     char * filename = argv[1];
21     unsigned int msecs = atoi(argv[2]);
22     int vm_fd = 0;
23     
24
25     if (argc <= 2) {
26         printf("usage: v3_simulate <vm-dev> <msecs>\n");
27         return -1;
28     }
29
30     printf("Simulating VM for %u msecs\n", msecs);
31     
32     vm_fd = open(filename, O_RDONLY);
33
34     if (vm_fd == -1) {
35         printf("Error opening V3Vee VM device\n");
36         return -1;
37     }
38
39     ioctl(vm_fd, 29, msecs); 
40
41     /* Close the file descriptor.  */ 
42     close(vm_fd); 
43  
44
45
46     return 0; 
47
48
49