ab5ba4730a37ead4a27370a2ad059c1ab1a67069
[virt-mem.git] / lib / virt_mem.mli
1 (** Memory info for virtual domains. *)
2 (* Memory info for virtual domains.
3    (C) Copyright 2008 Richard W.M. Jones, Red Hat Inc.
4    http://libvirt.org/
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *)
20
21 val register :
22   ?needs_ksyms:bool ->
23   ?needs_utsname:bool ->
24   ?needs_tasks:bool ->
25   ?needs_everything:bool ->
26   run:(bool -> Virt_mem_types.image -> Virt_mem_types.kdata -> unit) ->
27   ?external_cmd:bool ->
28   ?extra_args:(Arg.key * Arg.spec * Arg.doc) list ->
29   ?argcheck:(bool -> unit) ->
30   string -> string -> Arg.usage_msg ->
31   unit
32   (** Tools register themselves with this call.
33
34       The required parameters are:
35       - tool name (eg. "uname")
36       - short summary
37       - full usage message
38
39       The boolean parameters specify what kernel structures the
40       tool needs before it can run.  The main program will read
41       these structures in before calling [~run].
42       - [~needs_ksyms:true] if kernel symbols are needed
43       - [~needs_utsname:true] if kernel version (utsname) is needed
44       - [~needs_task_struct:true] if all task_struct (processes) are needed
45       - [~needs_everything:true] if the tool requires as much as
46       possible (but will not fail if we cannot determine everything)
47
48       The [~run] function is the tool's run function.  This function
49       is run once for each separate domain.  It may throw any exception,
50       which is printed out, but does not abort the program.  (If for
51       some reason you need to abort the whole program, call [exit].)
52
53       Pass [~external_cmd:false] if this tool doesn't have an
54       external 'virt-tool' link.
55
56       Pass [~extra_args:...] if this tool needs extra command
57       line options.
58
59       Pass [~argcheck:...] so that the tool can do any additional
60       parameter checks needed (eg. for [~extra_args]).
61   *)
62
63 val main : unit -> unit
64   (** Entry point for the combined virt-mem executable. *)