Split $os->{version} into $os->{major_version} and $os->{minor_version}
[libguestfs.git] / HACKING
1 PLEASE LOOK AT THE TOP OF EACH FILE BEFORE EDITING TO SEE WHETHER IT
2 IS AUTOMATICALLY GENERATED OR NOT.
3
4 Adding a new action
5 ----------------------------------------------------------------------
6
7 All action functions are generated automatically, so there are only
8 two files you need to edit:
9
10 (1) src/generator.ml: Add your new action, parameters, description,
11 etc. to the big list called 'functions' at the top of this file.
12
13 (2) Edit/create a C file in daemon/ subdirectory which implements your
14 'do_action' function.  Take a look at one of the numerous examples
15 there.
16
17 Formatting
18 ----------------------------------------------------------------------
19
20 Try to use GNU / Emacs default formatting, following the convention
21 used elsewhere in the source.
22
23 Please make sure that the code compiles without warnings.
24
25 Please test any changes.
26
27 Directories
28 ----------------------------------------------------------------------
29
30 appliance/
31         The qemu appliance, build scripts and so on.
32
33 cat/
34         The virt-cat tool.
35
36 capitests/
37         Automated tests of the C API.
38
39 contrib/
40         Outside contributions, experimental parts.
41
42 daemon/
43         The daemon that runs inside the guest and carries out actions.
44
45 df/
46         The virt-df tool.
47
48 examples/
49         The examples.
50
51 fish/
52         Guestfish (the command-line program / shell)
53
54 haskell/
55         Haskell bindings.
56
57 images/
58         Some guest images to test against.  These are gzipped to save
59         space.  You have to unzip them before use.
60
61         Also contains some files used by the test suite.
62
63 inspector/
64         Virtual machine image inspector (virt-inspector).
65
66 java/
67         Java bindings.
68
69 m4/
70         M4 macros used by autoconf.
71
72 ocaml/
73         OCaml bindings.
74
75 po/
76         Translations.
77
78 perl/
79         Perl bindings.
80
81 python/
82         Python bindings.
83
84 regressions/
85         Regression tests.
86
87 ruby/
88         Ruby bindings.
89
90 src/
91         Source code to the C library.
92         Also contains the crucial generator program.
93
94 v2v/
95         Xen to KVM (V2V) conversion tool.
96
97 Debugging
98 ----------------------------------------------------------------------
99
100 It's a good idea to use guestfish to try out new commands.
101
102 Debugging the daemon is a problem because it runs inside a minimal
103 qemu environment.  However you can print messages from the daemon, and
104 they will show up if you use 'guestfish -v'.
105
106 Patches
107 ----------------------------------------------------------------------
108
109 Submit patches to the mailing list:
110 http://www.redhat.com/mailman/listinfo/libguestfs
111 and CC to rjones@redhat.com
112
113 I18N
114 ----------------------------------------------------------------------
115
116 We support i18n (gettext anyhow) in the library.
117
118 However many messages come from the daemon, and we don't translate
119 those at the moment.  One reason is that the appliance generally has
120 all locale files removed from it, because they take up a lot of space.
121 So we'd have to readd some of those, as well as copying our PO files
122 into the appliance.
123
124 Debugging messages are never translated, since they are intended for
125 the programmers.