[Libguestfs] [nbdkit PATCH 1/4] server: Normalize plugin can_* values

Eric Blake eblake at redhat.com
Tue Mar 17 11:55:29 UTC 2020


On 3/17/20 3:10 AM, Richard W.M. Jones wrote:
> On Mon, Mar 16, 2020 at 10:36:14PM -0500, Eric Blake wrote:
>> The documentation for .can_write and friends mentioned merely that the
>> callback must return a boolean value, or -1 on failure.  Historically,
>> we have treated any non-zero value other than -1 as true, and some
>> plugins have sloppily relied on this behavior, including the
>> standalone nbd plugin prior to the use of libnbd in v1.14.  But in
>> 1.15.1, we added an assert in our backend code if an enabled feature
>> bit is not exactly 1.  To avoid tripping the assertion, we have to
>> normalize the plugin values before storing our internal value.
>>
>> Fixes: c306fa93ab
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---

> Nice one, ACK.
> 
> I guess this one will need to be backported to (only?) 1.16 and 1.18?

Those are the only two branches with the assertion failure.  Backporting 
to earlier versions is optional (it solves a latent bug, but unless we 
plan on backporting other patches that would tickle the latent bug, it 
seems like churn).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list