'$_' should be marked as a local variable in Sys::Guestfs::Lib::open_guest.
[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 capitests/
34         Automated tests of the C API.
35
36 contrib/
37         Outside contributions, experimental parts.
38
39 daemon/
40         The daemon that runs inside the guest and carries out actions.
41
42 df/
43         The virt-df tool.
44
45 examples/
46         The examples.
47
48 fish/
49         Guestfish (the command-line program / shell)
50
51 haskell/
52         Haskell bindings.
53
54 images/
55         Some guest images to test against.  These are gzipped to save
56         space.  You have to unzip them before use.
57
58         Also contains some files used by the test suite.
59
60 inspector/
61         Virtual machine image inspector (virt-inspector).
62
63 java/
64         Java bindings.
65
66 m4/
67         M4 macros used by autoconf.
68
69 ocaml/
70         OCaml bindings.
71
72 po/
73         Translations.
74
75 perl/
76         Perl bindings.
77
78 python/
79         Python bindings.
80
81 regressions/
82         Regression tests.
83
84 ruby/
85         Ruby bindings.
86
87 src/
88         Source code to the C library.
89         Also contains the crucial generator program.
90
91 v2v/
92         Xen to KVM (V2V) conversion tool.
93
94 Debugging
95 ----------------------------------------------------------------------
96
97 It's a good idea to use guestfish to try out new commands.
98
99 Debugging the daemon is a problem because it runs inside a minimal
100 qemu environment.  However you can print messages from the daemon, and
101 they will show up if you use 'guestfish -v'.
102
103 Patches
104 ----------------------------------------------------------------------
105
106 Submit patches to the mailing list:
107 http://www.redhat.com/mailman/listinfo/libguestfs
108 and CC to rjones@redhat.com
109
110 I18N
111 ----------------------------------------------------------------------
112
113 We support i18n (gettext anyhow) in the library.
114
115 However many messages come from the daemon, and we don't translate
116 those at the moment.  One reason is that the appliance generally has
117 all locale files removed from it, because they take up a lot of space.
118 So we'd have to readd some of those, as well as copying our PO files
119 into the appliance.
120
121 Debugging messages are never translated, since they are intended for
122 the programmers.