Change in osmo-bsc[master]: handover_ctrl: add control interface for handover settings

dexter gerrit-no-reply at
Tue Jul 6 12:50:46 UTC 2021

dexter has posted comments on this change. ( )

Change subject: handover_ctrl: add control interface for handover settings

Patch Set 6:

File include/osmocom/bsc/handover_cfg.h: 
PS6, Line 73: must end with a "\0",
> see neels' comment below, every string constant gets a \0 appended to it. […]
PS6, Line 264: 		"handover2 min-free-slots tch-h\0") \
> I guess this is a typo and he meant '\n'
File src/osmo-bsc/handover_ctrl.c: 
PS1, Line 33: bool verify_vty_cmd_arg(void *ctx, const char *range, const char *value)
> yes, for a reason
Its has the "vty" in the name because the function uses the same range descriptions like the VTY but feel free to suggest a different name for that function. 
File src/osmo-bsc/handover_ctrl.c: 
PS6, Line 32: /* Verify a VTY command argument against its value specification, the value
> Here we could add: […]
> Hm, I don't understand how this works. […]
When CTRL_CMD it is used the constant will be defined like "handover2 min-free-slots tch-h\0", VTY_CMD_PREFIX and VTY_CMD will still hold strings, but they are cut short by the \0 in that constant.

Unfortunately there is no way to get around this using #if in some way. The only way to get rid of this would be to use VTY_CMD only and repeat every VTY_CMD_PREFIX VTY_CMD in CTRL_CMD for all functions. At the moment VTY_CMD is an optional parameter that is only used when the string contains illegal characters so that a new string is needed to be defined.

I have found a better solution now. The command name string is filtered before the command is installed. That also means we can get rid of the CTRL_CMD parameter again. 
PS6, Line 114: 		cmd->reply = talloc_asprintf(cmd, "%s", #DEFAULT_VAL); \
> (we would usually also put { } around the else-scope)

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I12f143906818fd6b16e8783157cbb1eb51e49ffc
Gerrit-Change-Number: 24600
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier at>
Gerrit-Assignee: neels <nhofmeyr at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at>
Gerrit-Reviewer: fixeria <vyanitskiy at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: neels <nhofmeyr at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-Comment-Date: Tue, 06 Jul 2021 12:50:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr at>
Comment-In-Reply-To: laforge <laforge at>
Comment-In-Reply-To: pespin <pespin at>
Comment-In-Reply-To: dexter <pmaier at>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list