nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH v2 00/12] Policy based reconfiguration for daxctl
@ 2021-12-06 22:28 Vishal Verma
  2021-12-06 22:28 ` [ndctl PATCH v2 01/12] ndctl, util: add iniparser helper Vishal Verma
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Vishal Verma @ 2021-12-06 22:28 UTC (permalink / raw)
  To: nvdimm; +Cc: Dan Williams, QI Fuli, fenghua.hu, Vishal Verma

Changes since v1[1]:
- Collect review tags
- Fix 'make clean' removing the reconfigure script from the source tree
  (Fenghua, Qi)
- Documentation wordsmithing (Dan)
- Fix line break after declarations in parse-configs.c (Dan)
- Move daxctl config files to its own directory, /etc/daxctl/ (Dan)
- Improve failure mode in the absence of a configs directory
- Rename {nd,dax}ctl_{get|set}_configs to
  {nd,dax}ctl_{get|set}_configs_dir
- Exit with success if -C is specified, but no matching config section
  is found.
- Refuse to proceed if CLI options are passed in along with -C (Dan)
- In the config file, rename: s/[auto-online foo]/[reconfigure-device foo/
  and s/uuid/nvdimm.uuid/ (Dan)
- Teach device.c to accept /dev/daxX.Y instead of only daxX.Y and thus
  remove the need for a wrapper script that systemd invokes (Dan)

These patches add policy (config file) support to daxctl. The
introductory user is daxctl-reconfigure-device. Sysadmins may wish to
use daxctl devices as system-ram, but it may be cumbersome to automate
the reconfiguration step for every device upon boot.

Introduce a new option for daxctl-reconfigure-device, --check-config.
This is at the heart of policy based reconfiguration, as it allows
daxctl to look up reconfiguration parameters for a given device from the
config system instead of the command line.

Some systemd and udev glue then automates this for every new dax device
that shows up, providing a way for the administrator to simply list all
the 'system-ram' UUIDs in a config file, and not have to worry about
anything else.

An example config file can be:

  # cat /etc/ndctl/daxctl.conf

  [reconfigure-device unique_identifier_foo]
  nvdimm.uuid = 48d8e42c-a2f0-4312-9e70-a837faafe862
  mode = system-ram
  online = true
  movable = false

Any file under '/etc/ndctl/' can be used - all files with a '.conf' suffix
will be considered when looking for matches.

These patches depend on the initial config file support from Qi Fuli[2].

I've re-rolled Qi's original patches as the first five patches in this
series because of a change I made for graceful handling in the case of a
missing configs directory, and also to incorporate review feedback that
applied to the dependant patches. Patch 6 onwards is the actual v2 of
the daxctl policy work.

A branch containing these patches is available at [3].

[1]: https://lore.kernel.org/nvdimm/20210831090459.2306727-1-vishal.l.verma@intel.com/
[2]: https://lore.kernel.org/nvdimm/20210824095106.104808-1-qi.fuli@fujitsu.com/
[3]: https://github.com/pmem/ndctl/tree/vv/daxctl_config_v2

QI Fuli (5):
  ndctl, util: add iniparser helper
  ndctl, util: add parse-configs helper
  ndctl: make ndctl support configuration files
  ndctl, config: add the default ndctl configuration file
  ndctl, monitor: refator monitor for supporting multiple config files

Vishal Verma (7):
  ndctl: Update ndctl.spec.in for 'ndctl.conf'
  daxctl: Documentation updates for persistent reconfiguration
  util/parse-config: refactor filter_conf_files into util/
  daxctl: add basic config parsing support
  util/parse-configs: add a key/value search helper
  daxctl/device.c: add an option for getting params from a config file
  daxctl: add systemd service and udev rule for automatic
    reconfiguration

 .../daxctl/daxctl-reconfigure-device.txt      |  75 ++
 Documentation/ndctl/ndctl-monitor.txt         |   8 +-
 configure.ac                                  |  18 +-
 Makefile.am                                   |   8 +-
 ndctl/lib/private.h                           |   1 +
 daxctl/lib/libdaxctl.c                        |  39 +
 ndctl/lib/libndctl.c                          |  39 +
 daxctl/libdaxctl.h                            |   2 +
 ndctl/libndctl.h                              |   2 +
 util/dictionary.h                             | 175 ++++
 util/iniparser.h                              | 360 ++++++++
 util/parse-configs.h                          |  53 ++
 daxctl/daxctl.c                               |   1 +
 daxctl/device.c                               | 174 +++-
 ndctl/monitor.c                               |  73 +-
 ndctl/ndctl.c                                 |   1 +
 util/dictionary.c                             | 383 ++++++++
 util/iniparser.c                              | 838 ++++++++++++++++++
 util/parse-configs.c                          | 150 ++++
 Documentation/daxctl/Makefile.am              |  11 +-
 Documentation/ndctl/Makefile.am               |   2 +-
 daxctl/90-daxctl-device.rules                 |   1 +
 daxctl/Makefile.am                            |   9 +
 daxctl/daxdev-reconfigure@.service            |   8 +
 daxctl/lib/Makefile.am                        |   6 +
 daxctl/lib/libdaxctl.sym                      |   2 +
 ndctl.spec.in                                 |   4 +
 ndctl/Makefile.am                             |   9 +-
 ndctl/lib/Makefile.am                         |   6 +
 ndctl/lib/libndctl.sym                        |   2 +
 ndctl/ndctl.conf                              |  56 ++
 31 files changed, 2467 insertions(+), 49 deletions(-)
 create mode 100644 util/dictionary.h
 create mode 100644 util/iniparser.h
 create mode 100644 util/parse-configs.h
 create mode 100644 util/dictionary.c
 create mode 100644 util/iniparser.c
 create mode 100644 util/parse-configs.c
 create mode 100644 daxctl/90-daxctl-device.rules
 create mode 100644 daxctl/daxdev-reconfigure@.service
 create mode 100644 ndctl/ndctl.conf


base-commit: 4e646fa490ba4b782afa188dd8818b94c419924e
-- 
2.33.1


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-12-08 21:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 22:28 [ndctl PATCH v2 00/12] Policy based reconfiguration for daxctl Vishal Verma
2021-12-06 22:28 ` [ndctl PATCH v2 01/12] ndctl, util: add iniparser helper Vishal Verma
2021-12-07 18:24   ` Dan Williams
2021-12-07 21:50     ` Verma, Vishal L
2021-12-06 22:28 ` [ndctl PATCH v2 02/12] ndctl, util: add parse-configs helper Vishal Verma
2021-12-07 21:58   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 03/12] ndctl: make ndctl support configuration files Vishal Verma
2021-12-07 22:51   ` Dan Williams
2021-12-08  0:04     ` Verma, Vishal L
2021-12-08  0:19       ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 04/12] ndctl, config: add the default ndctl configuration file Vishal Verma
2021-12-08 16:00   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 05/12] ndctl, monitor: refator monitor for supporting multiple config files Vishal Verma
2021-12-08 16:00   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 06/12] ndctl: Update ndctl.spec.in for 'ndctl.conf' Vishal Verma
2021-12-08 21:47   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 07/12] daxctl: Documentation updates for persistent reconfiguration Vishal Verma
2021-12-08 21:51   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 08/12] util/parse-config: refactor filter_conf_files into util/ Vishal Verma
2021-12-08 21:52   ` Dan Williams
2021-12-06 22:28 ` [ndctl PATCH v2 09/12] daxctl: add basic config parsing support Vishal Verma
2021-12-06 22:28 ` [ndctl PATCH v2 10/12] util/parse-configs: add a key/value search helper Vishal Verma
2021-12-06 22:28 ` [ndctl PATCH v2 11/12] daxctl/device.c: add an option for getting params from a config file Vishal Verma
2021-12-06 22:28 ` [ndctl PATCH v2 12/12] daxctl: add systemd service and udev rule for automatic reconfiguration Vishal Verma
2021-12-06 23:10 ` [ndctl PATCH v2 00/12] Policy based reconfiguration for daxctl Verma, Vishal L
2021-12-07 11:24   ` qi.fuli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).