Validation_info

I’m trying to find out if there is a way to differentiate between a ‘commit’ and a ‘commit check’ from wthin a validation callback.

I noticed that confd_trans_ctx has a member ‘int validation_info’ and that it is set to ‘0’ when the callback is triggered through a commit and a ‘1’ when triggered through a ‘commit check’.

However, I am not seeing when or where validation_info is being used or why its being set to these values.

Is there another way to differentiate between the ‘commit’ and ‘commit check’ or does anyone know the purpose and settings of validation_info?

Have you searched the ConfD UG for “validation_info”? From the confd_lib_dp(3) man page, attached as an appendix to the ConfD User Guide:

In some cases it may be necessary for the validation callbacks to verify the availability of resources
that will be needed if the new configuration is committed. To support this kind of verification, the
validation_info element in the struct confd_trans_ctx can carry one of these flags:

CONFD_VALIDATION_FLAG_TEST
When this flag is set, the current validation phase is a "test" validation, as in e.g. the CLI 'validate'
command, and the transaction will return to the READ state regardless of the validation result. This
flag is available in all of the init(), validate(), and stop() callbacks.

CONFD_VALIDATION_FLAG_COMMIT
When this flag is set, all requirements for a commit have been met, i.e. all validation as well as the
write_start and prepare transitions have been successful, and the actual commit will follow. This flag
is only available in the stop() callback.