HomeFreeBSD

ztest: fix -o by calling set_global_var in child processes

Description

ztest: fix -o by calling set_global_var in child processes

Without set_global_var() in the child processes the -o option provides
little use.

Before this change set_global_var() was called as a side-effect of
getopt processing which only happens for the parent ztest process.

This change limits the set of options that can be set and makes them
available to the child through ztest_shared_opts_t.

Future work: support arbitrary option count and length.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Signed-off-by: Christian Schwarz <me@cschwarz.com>
Closes #11602

Details

Provenance
me_cschwarz.comAuthored on Feb 16 2021, 10:14 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 20 2021, 6:45 AM
Parents
rGedc508ac0b80: libzpool: set_global_var: refactor to not modify 'arg'
Branches
Unknown
Tags
Unknown