[libvirt] [PATCH v2 4/4] storage: Report error from VolOpen if proper flag is passed

Eric Blake eblake at redhat.com
Tue Apr 1 14:01:01 UTC 2014


On 04/01/2014 02:56 AM, Ján Tomko wrote:
> On 03/31/2014 08:50 PM, Cole Robinson wrote:
>> VolOpen notifies the user of a potentially non-fatal failure by
>> returning -2 and logging a VIR_WARN or VIR_INFO. Unfortunately most
>> callers treat -2 as fatal but don't actually report any message with
>> the error APIs.
>>

>> +    bool raise_error = (flags & VIR_STORAGE_VOL_OPEN_ERROR);
> 
> We've been using !!(flags & FLAG) for this kind of assignment, but I can't
> remember what that fixes.

It fixes the fact that gnulib's stdbool module works around C89
compilers that lack a native _Bool type, and therefore might assign a
value other than 1 into what is supposed to be 0 or 1.  But since we use
other C99 features, it probably doesn't hurt us to assume that
assignments to bool are handled correctly by the compiler.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140401/573ad3b2/attachment-0001.sig>


More information about the libvir-list mailing list