1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/report
Peter Rajnoha 335707b0e2 report: add infrastructure to recognize fuzzy reserved names and returning dynamic reserved values
With fuzzy names we mean the names for which it's hard or even impossible
to enumerate all possible variations of the name - the name needs to
be evaluated. An example of fuzzy name is a name which has a base
(substring) which matches and it can contain arbitrary variations
around this base. We can cover human language better with fuzzy
names as people may use several different names (or sentences) to
denote the same thing.

With dynamic values we mean the values which are not constants
and they need to be evaluated in runtime. An example of dynamic
value is a value which depends on current system state (e.g. time,
current configuration or any other state which may change and it
needs runtime evaluation).

There's a handler that can be registered with reporting/selection
using dm_report_reserved_handler instance. This is a central point
in which the computation/evaluation happens when processing reserved
values. Currently, there are two actions declared:

  DM_REPORT_RESERVED_PARSE_FUZZY_NAME
  (translates fuzzy name into canonical name)

  DM_REPORT_RESERVED_GET_DYNAMIC_VALUE
  (gets value for canonical name)

The handler is then registered as value in struct
dm_report_reserved_value (see explaining comments besided
the struct dm_report_reserved_value in libdevmapper.h).

Also, this patch provides support for simple caching of values
used during report/selection via dm_report_value_cache_{set,get}.
This is supposed to be used mainly in the dm_report_reserved_handler
instances to save values among calls so all the handler calls work
with the same base value used in computation/evaluation and/or
possibly to save resources if the evaluation is more time-consuming.
The cache is attached to the dm_report handle and so the cache is
dropped one dm_report is dropped.
2015-07-03 10:47:09 +02:00
..
columns-devtypes.h reporting: Add devtypes command. 2013-09-18 01:09:15 +01:00
columns.h cleanup: commit fe70b03 turned lv_time to STR, put it back to TIM 2015-07-03 09:22:48 +02:00
properties.c Add lvmlockd 2015-07-02 15:42:26 -05:00
properties.h report: select: refactor: move str_list to libdm 2014-06-17 16:27:20 +02:00
report.c report: add infrastructure to recognize fuzzy reserved names and returning dynamic reserved values 2015-07-03 10:47:09 +02:00
report.h cleanup: replace static struct processing_handle initializer with common init_processing_handle 2015-02-13 11:26:57 +01:00
values.h select: add support for range reserved values and flagging named-only values 2015-06-30 10:47:50 +02:00