On 09.02.21 19:49, Eric Blake wrote:
On 2/9/21 12:27 PM, Max Reitz wrote:
Many _unsupported_imgopts lines for refcount_bits values use something
like "refcount_bits=1[^0-9]" to forbid everything but "refcount_bits=1"
(e.g. "refcount_bits=16" is allowed).
That does not work when $IMGOPTS does not have any entry past the
refcount_bits option, which now became apparent with the "check" script
rewrite.
Use \b instead of [^0-9] to check for a word boundary, which is what we
really want.
\b is a Linux-ism (that is, glibc supports it, but BSD libc does not).
https://mail-index.netbsd.org/tech-userlevel/2012/12/02/msg006954.html
:(
Signed-off-by: Max Reitz <mre...@redhat.com>
---
Reproducible with:
$ ./check -qcow2 -o refcount_bits=1
(The tests touched here should be skipped)
I don't know whether \b is portable. I hope it is.
(This is why I CC-ed you, Eric.)
No, it's not portable. \> and [[:>:]] are other spellings for the same
task, equally non-portable.
Then again, it appears that nobody ever runs the iotests with
refcount_bits=1 but me, and I do that on Linux. So even if it isn't
portable, it shouldn't be an issue in practice... O:)
What exactly is failing? Is it merely a case of our python script
running the regex against "${unsupported_imgopts}" instead of
"${unsupported_imgsopts} " with an added trailing space to guarantee
that we have something to match against?
A bit of a hack, but one that indeed works, yes. Thanks!
Max