lockable: add QEMU_MAKE_LOCKABLE_NONNULL
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:17:20 +0000 (15:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:18:34 +0000 (15:18 +0100)
commit8834dcf47e8543b92e072706d3a5621762bfa106
tree19be9b785ca48b934ef4b580f17d5a203acebed8
parentf962cac4c24157aeceff59cbf9dac8b5e30c55da
lockable: add QEMU_MAKE_LOCKABLE_NONNULL

This will be needed for lock guards, because if the lock is NULL the
dummy for loop of the lock guard never runs.  This can cause confusion
and dummy warnings in the compiler, but even if it did not, aborting
with a NULL pointer dereference is a less surprising behavior.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/qemu/lockable.h