v1 was here:
https://www.redhat.com/archives/libguestfs/2019-June/thread.html#00055
v2 was here:
https://www.redhat.com/archives/libguestfs/2019-June/thread.html#00067
v3:
- Fix atomicly -> atomically in commit message.
- Fix a comment.
- Fix TOCTTOU: There is now an inline function generated called
<name>_is_permitted_state, and this is called twice, first outside
the lock for the quick rejection check, and again inside the lock
in case the state changed.
I think an improvement would be to _drop_ the first check (outside the
lock). This is an error check, so not performance critical since we
are definitely going to acquire the lock on the hot path.
Rich.