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.


Palacios GUI Added
[palacios.git] / linux_usr / v3_debug.c
1 /* 
2  * V3 debug interface
3  * (c) Jack Lange, 2012
4  */
5
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <sys/ioctl.h> 
10 #include <errno.h>
11 #include <assert.h>
12 #include <string.h>
13 #include <fcntl.h>
14 #include <unistd.h>
15
16 #include "v3_ctrl.h"
17
18
19 int main(int argc, char* argv[]) {
20     int vm_fd;
21     char * vm_dev = NULL;
22     struct v3_debug_cmd cmd; 
23
24     if (argc < 4) {
25         printf("usage: v3_debug <vm_device> <vm core> <cmd>\n");
26         return -1;
27     }
28
29     vm_dev = argv[1];
30     cmd.core = atoi(argv[2]);
31     cmd.cmd = atoi(argv[3]);
32
33     printf("Debug Virtual Core %d with Command %d\n", cmd.core, cmd.cmd);
34
35     vm_fd = open(vm_dev, O_RDONLY);
36
37     if (vm_fd == -1) {
38         printf("Error opening VM device: %s\n", vm_dev);
39         return -1;
40     }
41
42     int err = ioctl(vm_fd, V3_VM_DEBUG, &cmd); 
43
44     if (err < 0) {
45         printf("Error write core migrating command to vm\n");
46         return -1;
47     }
48
49     close(vm_fd); 
50
51     return 0; 
52 }
53
54