]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/osd: disable allow_guessing when parsing command line options
authorKefu Chai <kchai@redhat.com>
Fri, 21 May 2021 12:10:38 +0000 (20:10 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 21 May 2021 12:17:04 +0000 (20:17 +0800)
commit22ea087c17edc3a705586f06bd599bec98f66293
treeca0b90d6ffc57981bcce09636f6893760524f873
parent4723d3c582ea1b607ce326d068bf789aeae081f0
crimson/osd: disable allow_guessing when parsing command line options

we pass "--id <n>" to ceph-osd for specifying the osd id, but seastar
app template also provides an option of "--idle-poll-time-us arg".
boost::program_option::command_line_parser() uses default_style when
parsing options. and default_style includes allow_guessing, which in
turn matches partial option as well, so "--id" matches with "--idle"
when we are trying to figure out which options are consumed by seastar
app template, and which are not. see
https://www.boost.org/doc/libs/1_76_0/doc/html/boost/program_options/command_line_style/style_t.html

so, in this change, stype is specified explicitly, and "allow_guessing"
is removed from the "default_style" before being passed to style(), so
that only the full option name are matched.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/main.cc