All of lore.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH v3 00/11] Policy based reconfiguration for daxctl
@ 2021-12-10 22:34 Vishal Verma
  2021-12-10 22:34 ` [ndctl PATCH v3 01/11] ndctl, util: add parse-configs helper Vishal Verma
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Vishal Verma @ 2021-12-10 22:34 UTC (permalink / raw)
  To: nvdimm; +Cc: Dan Williams, QI Fuli, fenghua.hu, Vishal Verma

Changes since v2[1]:
- Remove stale Link: trailers from commit messages (Dan)
- Link to the iniparser library already packaged by distros instead of
  forking it (Dan).
- Improve commit message for "ndctl, util: add parse-configs helper"
  (Dan)
- Squash "util/parse-config: refactor filter_conf_files into util/" into
  the original patch it modifies since I'm modifying Qi's original
  patchset anyway
- Rename {ndctl,daxctl}_{get,set}_configs_dir to
  {ndctl,daxctl}_{get,set}_config_path (Dan)
- Replace {ndctl,daxctl}_ctx ** ctx with *ctx respectively, as the
  former is unnecessary. (Dan)
- Allow *_set_config_path() to return errors (Dan)
- Move {ndctl,daxctl}_set_config_path into {ndctl,daxctl}_new (Dan)
- Update config paths to {sysconfdir}/{ndctl,daxctl}.conf.d/  (Dan)
- Move the config_path scandir() call deeper in the stack so we don't
  have to store scandir results anywhere, and so that it is run just
  before the config parsing happens. This way the only thing that's
  stored in 'ctx' is the config_path itself, and lib{nd,dax}ctl are
  freed of having to link to GPL utils such as util/strbuf.  (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/daxctl.conf.d/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/daxctl.conf.d/' 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,
which is included here after some modifications from review feedback.

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

[1]: https://lore.kernel.org/nvdimm/20211206222830.2266018-1-vishal.l.verma@intel.com/
[2]: https://github.com/pmem/ndctl/tree/vv/daxctl_config_v3


QI Fuli (4):
  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
  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: add and install an example config file

 .../daxctl/daxctl-reconfigure-device.txt      |  75 ++++++++
 Documentation/ndctl/ndctl-monitor.txt         |   8 +-
 configure.ac                                  |  22 ++-
 Makefile.am                                   |   2 +
 ndctl/lib/private.h                           |   1 +
 daxctl/lib/libdaxctl.c                        |  20 ++
 ndctl/lib/libndctl.c                          |  20 ++
 daxctl/libdaxctl.h                            |   2 +
 ndctl/libndctl.h                              |   2 +
 util/parse-configs.h                          |  53 ++++++
 daxctl/device.c                               | 174 +++++++++++++++++-
 ndctl/monitor.c                               |  73 ++++----
 util/parse-configs.c                          | 156 ++++++++++++++++
 Documentation/daxctl/Makefile.am              |  11 +-
 Documentation/ndctl/Makefile.am               |   2 +-
 daxctl/90-daxctl-device.rules                 |   1 +
 daxctl/Makefile.am                            |  14 +-
 daxctl/daxctl.example.conf                    |  27 +++
 daxctl/daxdev-reconfigure@.service            |   8 +
 daxctl/lib/Makefile.am                        |   6 +
 daxctl/lib/libdaxctl.sym                      |   2 +
 ndctl.spec.in                                 |   7 +-
 ndctl/Makefile.am                             |  11 +-
 ndctl/lib/Makefile.am                         |   6 +
 ndctl/lib/libndctl.sym                        |   2 +
 ndctl/ndctl.conf                              |  56 ++++++
 26 files changed, 710 insertions(+), 51 deletions(-)
 create mode 100644 util/parse-configs.h
 create mode 100644 util/parse-configs.c
 create mode 100644 daxctl/90-daxctl-device.rules
 create mode 100644 daxctl/daxctl.example.conf
 create mode 100644 daxctl/daxdev-reconfigure@.service
 create mode 100644 ndctl/ndctl.conf


base-commit: 4e646fa490ba4b782afa188dd8818b94c419924e
-- 
2.33.1


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

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

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 22:34 [ndctl PATCH v3 00/11] Policy based reconfiguration for daxctl Vishal Verma
2021-12-10 22:34 ` [ndctl PATCH v3 01/11] ndctl, util: add parse-configs helper Vishal Verma
2021-12-16 21:42   ` Dan Williams
2021-12-17 21:31     ` Verma, Vishal L
2021-12-21 12:54   ` Joao Martins
2021-12-10 22:34 ` [ndctl PATCH v3 02/11] ndctl: make ndctl support configuration files Vishal Verma
2021-12-16 21:47   ` Dan Williams
2021-12-10 22:34 ` [ndctl PATCH v3 03/11] ndctl, config: add the default ndctl configuration file Vishal Verma
2021-12-10 22:34 ` [ndctl PATCH v3 04/11] ndctl, monitor: refator monitor for supporting multiple config files Vishal Verma
2021-12-10 22:34 ` [ndctl PATCH v3 05/11] ndctl: Update ndctl.spec.in for 'ndctl.conf' Vishal Verma
2021-12-10 22:34 ` [ndctl PATCH v3 06/11] daxctl: Documentation updates for persistent reconfiguration Vishal Verma
2021-12-10 22:34 ` [ndctl PATCH v3 07/11] daxctl: add basic config parsing support Vishal Verma
2021-12-16 22:37   ` Dan Williams
2021-12-10 22:34 ` [ndctl PATCH v3 08/11] util/parse-configs: add a key/value search helper Vishal Verma
2021-12-16 22:44   ` Dan Williams
2021-12-10 22:34 ` [ndctl PATCH v3 09/11] daxctl/device.c: add an option for getting params from a config file Vishal Verma
2021-12-16 22:45   ` Dan Williams
2021-12-10 22:34 ` [ndctl PATCH v3 10/11] daxctl: add systemd service and udev rule for automatic reconfiguration Vishal Verma
2021-12-16 23:03   ` Dan Williams
2021-12-10 22:34 ` [ndctl PATCH v3 11/11] daxctl: add and install an example config file Vishal Verma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.