Implement 'strings' and 'hexdump' commands.
[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 daemon/
35         The daemon that runs inside the guest and carries out actions.
36
37 examples/
38         The examples.
39
40 fish/
41         Guestfish (the command-line program / shell)
42
43 images/
44         Some guest images to test against.  These are gzipped to save
45         space.  You have to unzip them before use.
46
47         Also contains some files used by the test suite.
48
49 inspector/
50         Virtual machine image inspector (virt-inspector).
51
52 java/
53         Java bindings.
54
55 m4/
56         M4 macros used by autoconf.
57
58 ocaml/
59         OCaml bindings.
60
61 perl/
62         Perl bindings.
63
64 python/
65         Python bindings.
66
67 ruby/
68         Ruby bindings.
69
70 src/
71         Source code to the C library.
72         Also contains the crucial generator program.
73
74 Debugging
75 ----------------------------------------------------------------------
76
77 It's a good idea to use guestfish to try out new commands.
78
79 Debugging the daemon is a problem because it runs inside a minimal
80 qemu environment.  However you can print messages from the daemon, and
81 they will show up if you use 'guestfish -v'.
82
83 Patches
84 ----------------------------------------------------------------------
85
86 Submit patches to the fedora-virt mailing list:
87 http://www.redhat.com/mailman/listinfo/fedora-virt
88 and CC to rjones@redhat.com