plugins: Consistent error handling on FUA
commit2fc1e53ee17400ac4de2ff2dd20a7ca71beb74f7
authorEric Blake <eblake@redhat.com>
Tue, 13 Feb 2018 22:32:43 +0000 (13 16:32 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 14 Feb 2018 16:50:41 +0000 (14 10:50 -0600)
treeda5d7466a9f6c13c81162c3ecc537303f714b3ba
parentd1bb69c2380ec4858641b0728af50db43e2ab6e8
plugins: Consistent error handling on FUA

We document that a plugin callback should return 0 on success, but
other places in the code treat all values other than -1 as success
(perhaps we should treat all negative values as errors, instead of
exactly -1, but that may break binary back-compatibility).  However,
when reworking where FUA fallback occurs, we introduced a subtle
change: if a plugin returns a non-zero value on success despite the
documentation, and the client requested FUA, we ended up reporting
success to the client without performing FUA.

Fixes: 4f37c64ffdd42fab5c5d9c6157db396b60866a7a
Signed-off-by: Eric Blake <eblake@redhat.com>
src/plugins.c