Make CHROOT_IN/OUT macros should loudly if the syscall fails.
[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 You will need to run src/generator.ml (from the top directory) which
18 regenerates all the auto-generated files, and then continue with the
19 ordinary build process.
20
21 Formatting
22 ----------------------------------------------------------------------
23
24 Try to use GNU / Emacs default formatting, following the convention
25 used elsewhere in the source.
26
27 Please make sure that the code compiles without warnings.
28
29 Please test any changes.
30
31 Directories
32 ----------------------------------------------------------------------
33
34 appliance/
35         The qemu appliance, build scripts and so on.
36
37 capitests/
38         Automated tests of the C API.
39
40 contrib/
41         Outside contributions, experimental parts.
42
43 daemon/
44         The daemon that runs inside the guest and carries out actions.
45
46 examples/
47         The examples.
48
49 fish/
50         Guestfish (the command-line program / shell)
51
52 haskell/
53         Haskell bindings.
54
55 images/
56         Some guest images to test against.  These are gzipped to save
57         space.  You have to unzip them before use.
58
59         Also contains some files used by the test suite.
60
61 inspector/
62         Virtual machine image inspector (virt-inspector).
63
64 java/
65         Java bindings.
66
67 m4/
68         M4 macros used by autoconf.
69
70 ocaml/
71         OCaml bindings.
72
73 po/
74         Translations.
75
76 perl/
77         Perl bindings.
78
79 python/
80         Python bindings.
81
82 regressions/
83         Regression tests.
84
85 ruby/
86         Ruby bindings.
87
88 src/
89         Source code to the C library.
90         Also contains the crucial generator program.
91
92 Debugging
93 ----------------------------------------------------------------------
94
95 It's a good idea to use guestfish to try out new commands.
96
97 Debugging the daemon is a problem because it runs inside a minimal
98 qemu environment.  However you can print messages from the daemon, and
99 they will show up if you use 'guestfish -v'.
100
101 Patches
102 ----------------------------------------------------------------------
103
104 Submit patches to the fedora-virt mailing list:
105 http://www.redhat.com/mailman/listinfo/fedora-virt
106 and CC to rjones@redhat.com
107
108 I18N
109 ----------------------------------------------------------------------
110
111 We support i18n (gettext anyhow) in the library.
112
113 However many messages come from the daemon, and we don't translate
114 those at the moment.  One reason is that the appliance generally has
115 all locale files removed from it, because they take up a lot of space.
116 So we'd have to readd some of those, as well as copying our PO files
117 into the appliance.
118
119 Debugging messages are never translated, since they are intended for
120 the programmers.