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.


added coding guidelines
[palacios.git] / CODING_GUIDELINES
1 This is a set of guidelines for how to understand and write code for
2 the V3 Hypervisor. 
3
4 Fail Stop:
5 Because booting a basic linux kernel results in over 1 million VM exits
6 it is catching silent errors is next to impossible. For this reason
7 ANY time your code has an error it should return -1, and expect the
8 execution to halt. 
9
10 This includes unimplemented features and unhandled cases. These cases
11 should ALWAYS return -1. 
12
13
14 Function names:
15 To ease porting externally visible function names should be used
16 rarely and have unique names. Currently we have several techniques for
17 achieving this:
18
19 1. #ifdefs in the header file
20 When the V3 Hypervisor is compiled it defines the symbol
21 __V3VEE__. Any function that is not needed outside the Hypervisor
22 context should be inside an #ifdef __V3VEE__ block, this will make it
23 invisible to the host environment.
24
25 2. static functions
26 Any utility functions that are only needed in the .c file where they
27 are defined should be declared as static and not included in the
28 header file. 
29
30 3. "v3_" prefix
31 Major interface functions should be named with the prefix "v3_". This
32 allows easy understanding of how to interact with the subsystems. And
33 in the case that they need to be externally visible to the host os,
34 make them unlikely to collide with other functions. 
35
36
37
38
39 Debugging Output:
40 Debugging output is sent through the host os via functions in the
41 os_hooks structure. These functions have various wrappers of the form
42 Print*, with printf style semantics. 
43
44 Two functions of note are PrintDebug and PrintError.
45
46 PrintDebug:
47 Should be used for debugging output that will often be
48 turned off selectively by the VMM configuration. 
49
50 PrintError:
51 Should be used when an error occurs, this will never be optimized out
52 and will always print. 
53