Skip to content

[cfg] Better configuration handling #708

@vankoven

Description

@vankoven

Although issue #698 was fixed, fix in patch set #707 seems to be workaround not the solution. It introduces a couple of restrictions developers have to keep in mind while writing new configuration specifications. Patch should be reworked in future cfg updates.

Solution should be have done in the next way (fix from #707 must be rolled back):

Before processing nested entries of TfwCfgSpec, theirs .call_counters must be reset, but for a proper handling .cleanup() functions .call_counters must contain values, generated by CfgParser.
Let's introduce new member in TfwCfgSpecChild called TfwCfgSpec *childs_copy;.

tfw_cfg_handle_children() should be reworked:

  • copy nested entries to ((TfwCfgSpecChild *)parent_entry->spec_ext)->childs_copy, if copy does not exist;
  • reset call_counter for every spec in copy;
  • parse nested configuration using copy, not the original specs;
  • add call_counters from copied to original specs.

Copied entries must be freed in tfw_cfg_cleanup_children().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions