[libvirt] [PATCHv6 2/5] Add hostdev passthrough common library

Eric Blake eblake at redhat.com
Fri Nov 22 22:16:10 UTC 2013


On 11/22/2013 03:02 PM, Jim Fehlig wrote:
> Chunyan Liu wrote:
>> Add hostdev passthrough common library so that it could be shared by all drivers
>> and maintain a global hostdev state.
>>   
> 
> Hi Chunyan,
> 
> Looks like you addressed all of Daniel's comments from v5. One bug fix
> and a few additional comments below...
> 

>> +        bool strict_acs_check = (flags & VIR_STRICT_ACS_CHECK)?true:false;
>>   
> 
> Needs some whitespace, e.g.
> 
> bool coldBoot = (flags & VIR_COLD_BOOT) ? true : false;

Or even simpler:

bool coldBoot = !!(flags & VIR_COLD_BOOT);

[Technically, we can go one further, if we could rely on 'bool' actually
obeying C99:

bool coldBoot = flags & VIR_COLD_BOOT;

but that still gives me the willies, because we are using gnulib's
<stdbool.h> as needed for portability.  Gnulib documents that when it is
working around the more blatant bugs in fringe/old compilers, it can no
longer guarantee the C99 semantics of assignment to bool implicitly
flattening non-zero values to 'true'.  In fact, I suspect RHEL 5 gcc may
be one such compiler that doesn't have full C99 bool rule compliance]

-- 
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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131122/f00501a4/attachment-0001.sig>


More information about the libvir-list mailing list