All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] xfsprogs: add mkfs.xfs configuration file parsing support
@ 2018-05-29 22:05 Luis R. Rodriguez
  2018-05-29 22:06 ` [PATCH v4 1/4] mkfs: distinguish between struct sb_feat_args and struct cli_params Luis R. Rodriguez
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Luis R. Rodriguez @ 2018-05-29 22:05 UTC (permalink / raw)
  To: sandeen, linux-xfs
  Cc: darrick.wong, jack, jeffm, okurz, lpechacek, jtulak, Luis R. Rodriguez

This is v4 series addresses the feedback from Darrick mostly on man page
text changes and a few minor code updates listed below. I've also
amended the patches with Reviewed-by tags where appropriate, and rebased
it onto the latest origin/for-next branch. The details of the changes in
this v4 iteration and prior are listed below.

You can also get the code from my kernel.org xfsprogs-dev 20180529-own-parser-v4
branch [0].

Reviews, questions, or rants are greatly appreciated.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/xfsprogs-dev.git/log/?h=20180529-own-parser-v4

Changes on v4:

- Tons of man page documentation enhancements from Darrick.

- Adjusted a few error code messages/ paths to make more sense as per
  Darrick's feedback.

Changes on v3:

- Prefix errors on the configuration parsing with config file used and
  exact line.

- Use uint64_t throughout all parsers as requested.

- Parse the CLI early for -c as I originally had implemented this on v1
  but now platform_getoptreset() to reset the opts.

- Drop the enum for the source type for the configuration file type,
  note that since we rely on the stack to set the variables we should
  then always set the dft.src on main().

- Use getline() for fetching lines as requested

- Add a special iscomment() and isempty() to handle all space and
  comment parsing. Now when PARSE_INVALID issued we really mean it.

- Embrace latest bikeshed preferences:
        config.c, config.h, random function names

- Add man pages to be parsed via configure so that @sysconfigdir@ gets
  properly parsed

- get_confopts() now iterates over the known sections tab and gives you
  the right struct right away.

- Add respecification checks for a section.

- Add respecification checks for -c, -c is only allowed once.

- Add --sysconfigdir to debian/rules, note that if you *don't* set
  --sysconfigdir your man pages will end up with ${prefix}. We could
  add a secondary target parsing just in case, or we can do some hacks
  with autoconf for this, but I don't think its worth it. Other packages
  deal with this by having ./configure always run with --sysconfigdir
  set (see systemd for instance).

- Reduced the number of declared enums, only enums for the config
  subparams which are currently supported for parsing are declared.

- mkfs.xfs -c foo now will search for $PWD/foo and if that fails the
  sysconfigdir/mkfs.xfs.d/foo.

- mkfs.xfs -c ../foo works and so should ./foo, etc.

- The MKFS_XFS_CONFIG variable support was dropped in favor or just
  allowing the user to specify the full path now.

- Embraces xfsprogs coding style, c'est la vie.

Changes on v2:

- Stayed with our own parser as its the smallest and we're willing to
  maintain it as its simple and clear.

- Use -c for the configuration file, and drop the "type" nomenclature to
  avoid confusion on the interwebs.

- Start to split files off

- Duplicate a bit of items as suggested at LSFMM for the configuration
  parser structures. We can later consolidate if we think its really
  needed, however we want the freedom to change these as we see fit and
  most importantly keep the code apart.

- Conflict resolution and validation is managed now by piggy backing off
  of the idea of using the defaults to instantiate CLI parameters. CLI
  always overrides.

Luis R. Rodriguez (4):
  mkfs: distinguish between struct sb_feat_args and struct cli_params
  mkfs: move shared config structs and into their own headers
  mkfs.xfs: add configuration file parsing support using our own parser
  debian/rules: use the new sysconfdir configuration setting

 configure.ac                           |   6 +-
 debian/rules                           |   4 +-
 include/builddefs.in                   |   2 +
 man/man5/Makefile                      |   2 +
 man/man5/mkfs.xfs.d.5.in               | 151 ++++++++
 man/man8/Makefile                      |   2 +
 man/man8/{mkfs.xfs.8 => mkfs.xfs.8.in} |  27 ++
 mkfs/Makefile                          |   2 +-
 mkfs/config.c                          | 645 +++++++++++++++++++++++++++++++++
 mkfs/config.h                          |  86 +++++
 mkfs/xfs_mkfs.c                        | 130 ++++---
 11 files changed, 994 insertions(+), 63 deletions(-)
 create mode 100644 man/man5/mkfs.xfs.d.5.in
 rename man/man8/{mkfs.xfs.8 => mkfs.xfs.8.in} (96%)
 create mode 100644 mkfs/config.c
 create mode 100644 mkfs/config.h

-- 
2.16.3


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

end of thread, other threads:[~2018-06-01 21:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 22:05 [PATCH v4 0/4] xfsprogs: add mkfs.xfs configuration file parsing support Luis R. Rodriguez
2018-05-29 22:06 ` [PATCH v4 1/4] mkfs: distinguish between struct sb_feat_args and struct cli_params Luis R. Rodriguez
2018-05-29 22:06 ` [PATCH v4 2/4] mkfs: move shared config structs and into their own headers Luis R. Rodriguez
2018-05-30  1:28   ` Dave Chinner
2018-05-29 22:06 ` [PATCH v4 3/4] mkfs.xfs: add configuration file parsing support using our own parser Luis R. Rodriguez
2018-05-29 23:31   ` Darrick J. Wong
2018-06-01 21:56     ` Luis R. Rodriguez
2018-05-30  2:09   ` Eric Sandeen
2018-05-30  3:33   ` Eric Sandeen
2018-05-30  3:33   ` Dave Chinner
2018-06-01 21:13     ` Luis R. Rodriguez
2018-05-30  7:36   ` Martin Steigerwald
2018-05-30 16:06   ` Darrick J. Wong
2018-05-30 18:10   ` [PATCH 3.5/4] mkfs.xfs: document defaults config file details Eric Sandeen
2018-05-30 18:30     ` Darrick J. Wong
2018-05-30 18:37       ` Eric Sandeen
2018-05-30 20:51     ` [PATCH 3.5/4 V2] " Eric Sandeen
2018-05-30 22:08       ` Darrick J. Wong
2018-05-30 21:05   ` [PATCH 3.7/4] mkfs.xfs.8: parameterize sysconfdir Eric Sandeen
2018-05-30 22:10     ` Darrick J. Wong
2018-05-29 22:06 ` [PATCH v4 4/4] debian/rules: use the new sysconfdir configuration setting Luis R. Rodriguez

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.