Page MenuHomeFreeBSD

ctld: Add a dedicated API between parse.y and the rest of the program
Needs ReviewPublic

Authored by jhb on Tue, Feb 11, 1:20 AM.

Details

Reviewers
asomers
Summary

The primary purpose of this is to permit the rest of ctld to use C++.
However, this also has the nice side effect of reducing code
duplication with the UCL parser.

As a general rule, setting of options including error handling for
invalid values, etc. is moved out of parse.y and into ctld.c. The
intention is that all of the functions declared in parse.h will be
extern "C" for use by parse.y.

A few other small changes are included with this refactoring:

  • Warn and fail a configuration that specifies the same LUN multiple times for a target.
  • Use T_* constants for SCSI device types instead of magic numbers.
  • Warn and fail for a few UCL properties that aren't the required type including "discovery-auth-group" in a portal group context, "auth-type" and "port" in a target context.
  • Fix a bug where chap-mutual in a target in UCL would not auto-create a new auth-group.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62361
Build 59245: arc lint + arc unit