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.


Avoid strict-aliasing related issues when compiling with optimization
[palacios.git] / linux_usr / v3_pause.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 read_file(int fd, int size, unsigned char * buf);
19
20 int main(int argc, char* argv[]) {
21     char * filename = argv[1];
22     int vm_fd = 0;
23  
24
25     if (argc <= 1) {
26         printf("usage: v3_pause <vm_device>\n");
27         return -1;
28     }
29
30     printf("Pausing VM\n");
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, 23, NULL); 
40
41
42
43     /* Close the file descriptor.  */ 
44     close(vm_fd); 
45  
46
47
48     return 0; 
49
50
51