12Building the KVM kernel module is performed differently depending on whether
13you are working from a clone of the git repository or from a source release.
14Notice that two kernels are involved: One from which the KVM sources
15are taken (kernel A), and one for which the module is built (kernel B).
16In almost all cases, kernel A is more recent than kernel B.
18- To build from a release (this is the default case), simply
19 use ./configure (possibly with any arguments that are required for
20 your setup, see ./configure --help) and make. The kernel specified
21 with --kerneldir refers to kernel B, that is, the kernel for which
22 the module is built. All sources required from kernel A are already
23 included in the release.
25- Building from a cloned git repository (most likely useful for developers
26 only) requires a kernel tree with the main kvm sources (kernel A) that
27 is included as a submodule in the linux-2.6/ directory. By default,
28 the KVM development tree on git.kernel.org is used, but this can be
29 changed in the git configuration after the 'submodule init' step.
31 Before the kvm module can be built, the linux submodule must be initialised
32 and populated. The required sequence of commands is
34 git submodule init
35 git submodule update
37 make sync
40 Notice that you can also specify an existing Linux tree for the
41 synchronisation stage by using
43 make sync LINUX=/path/to/kernel/A
45 LINUX specifies the path to kernel A from which the KVM sources are taken.
46 The directory must point to a local git tree, not to a plain directory
47 containing the kernel sources. If LINUX is unset, the default value
48 is linux-2.6/, i.e., the git submodule.
50 Note that configure may refuse to build against your target kernel if it
51 considers it too new or too old. If you know what you are doing, you can
52 override this check by passing --force.