Imported Upstream version 0.7.4
[platform/upstream/multipath-tools.git] / libdmmp / DEV_NOTES
1 == Planed features ==
2  * Expose all properties used by /usr/bin/multipath
3
4 == Code style ==
5  * Keep things as simple as possible.
6  * Linux Kernel code style.
7  * Don't use typedef.
8  * Don't use enum.
9  * We are not smarter than API user, so don't create wrapping function like:
10
11     ```
12     dmmp_mpath_search_by_id(struct dmmp_context *ctx,
13                             struct dmmp_mpath **dmmp_mp,
14                             uint32_t dmmp_mp_count, const char *id)
15
16     dmmp_path_group_id_search(struct dmmp_mpath *dmmp_mp,
17                               const char *blk_name)
18     ```
19  * The performance is the same for query single mpath and query all mpaths,
20    so no `dmmp_mpath_of_wwid(struct dmmp_context *ctx, const char *wwid)` yet.
21
22 == Naming scheme ==
23  * Public constants should be named as `DMMP_XXX_YYY`.
24  * Public functions should be named as `dmmp_<noun>_<verb>`.
25  * Private constants should be named as `_DMMP_XXX_YYY`.
26  * Private functions should be named as `_dmmp_<noun>_<verb>`.
27
28 == Code Layout ==
29  * libdmmp_private.h
30     Internal functions or macros.
31  * libdmmp.c
32     Handling multipathd IPC and generate dmmp_context and
33     dmmp_mpath_array_get().
34  * libdmmp_mp.c
35     For `struct dmmp_mpath`
36  * libdmmp_pg.c
37     For `struct dmmp_path_group`
38  * libdmmp_path.c
39     For `struct dmmp_path`
40  * libdmmp_misc.c
41     Misc functions.