mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository
https://sourceware.org/lvm2/
e29cd366a2
There's a possibility to interconnect the dm_config_node with an ID, which in our case is used to reference the configuration definition ID from config_settings.h. So simply interconnecting struct dm_config_node with struct cfg_def_item. This patch also adds support for enhanced config node output besides existing "output line by line". This patch adds a possibility to register a callback that gets called *before* the config node is processed line by line (for example to include any headers on output) and *after* the config node is processed line by line (to include any footers on output). Also, it adds the config node reference itself as the callback arg in addition to have a possibility to extract more information from the config node itself if needed when processing the output callback (e.g. the key name, the id, or whether this is a section or a value etc...). If the config node from lvm.conf/--config tree is recognized and valid, it's always coupled with the config node definition ID from config_settings.h: struct dm_config_node { int id; const char *key; struct dm_config_node *parent, *sib, *child; struct dm_config_value *v; } For example if the dm_config_node *cn holds "devices/dev" configuration, then the cn->id holds "devices_dev_CFG" ID from config_settings.h, -1 if not found in config_settings.h and 0 if matching has not yet been done. To support the enhanced config node output, a new structure has been defined in libdevmapper to register it: struct dm_config_node_out_spec { dm_config_node_out_fn prefix_fn; /* called before processing config node lines */ dm_config_node_out_fn line_fn; /* called for each config node line */ dm_config_node_out_fn suffix_fn; /* called after processing config node lines */ }; Where dm_config_node_out_fn is: typedef int (*dm_config_node_out_fn)(const struct dm_config_node *cn, const char *line, void *baton); (so in comparison to existing callbacks for config node output, it has an extra dm_config_node *cn arg in addition) This patch also adds these functions to libdevmapper: - dm_config_write_node_out - dm_config_write_one_node_out ...which have exactly the same functionality as their counterparts without the "out" suffix. The "*_out" functions adds the extra hooks for enhanced config output (prefix_fn and suffix_fn mentioned above). One can still use the old interface for config node output, this is just an enhancement for those who'd like to modify the output more extensively. |
||
---|---|---|
autoconf | ||
daemons | ||
doc | ||
include | ||
lib | ||
libdaemon | ||
libdm | ||
liblvm | ||
man | ||
old-tests | ||
po | ||
python | ||
report-generators | ||
reports | ||
scripts | ||
test | ||
tools | ||
udev | ||
unit-tests | ||
.gitignore | ||
aclocal.m4 | ||
configure | ||
configure.in | ||
COPYING | ||
COPYING.LIB | ||
INSTALL | ||
make.tmpl.in | ||
Makefile.in | ||
README | ||
VERSION | ||
VERSION_DM | ||
WHATS_NEW | ||
WHATS_NEW_DM |
This tree contains the LVM2 and device-mapper tools and libraries. For more information about LVM2 read the changelog in the WHATS_NEW file. Installation instructions are in INSTALL. There is no warranty - see COPYING and COPYING.LIB. Tarballs are available from: ftp://sources.redhat.com/pub/lvm2/ The source code is stored in git: http://git.fedorahosted.org/git/lvm2.git git clone git://git.fedorahosted.org/git/lvm2.git Mailing list for general discussion related to LVM2: linux-lvm@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm Mailing lists for LVM2 development, patches and commits: lvm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm lvm2-commits@lists.fedorahosted.org (Read-only archive of commits) Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits Mailing list for device-mapper development, including kernel patches and multipath-tools: dm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel The source code repository used until 7th June 2012 is accessible here: http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.