[libvirt] [PATCH v2 0/2] small gluster fixes
Eric Blake
eblake at redhat.com
Thu Feb 6 20:56:17 UTC 2014
On 02/06/2014 11:09 AM, Christophe Fergeau wrote:
>
> I've played a bit with adding some compile time checks to avoid this in the future, but
> while they work, they are a bit ugly-looking, and they would require some changes in
> docs/apibuild.py to teach it to parse 1 << N, or to make it ignore values
> in #ifdef VIR_ENUM_SENTINELS, so before spending too much time on this, I'd like to know
> if these checks would be a welcome/useful addition.
Hmm, we don't add pools every day.
>
> +/* Check if VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE seems to
> + * contain all virConnectListAllStoragePoolsFlags elements
> + */
> +verify(VIR_CONNECT_LIST_STORAGE_POOLS_LAST < VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE);
> +
> +/* Check if virConnectListAllStorageFlags has one flag per known storage
> + * pool type */
> +verify(1 << (5+VIR_STORAGE_POOL_LAST) == VIR_CONNECT_LIST_STORAGE_POOLS_LAST - 1);
Wow, that does look pretty ugly and hard-coded. At this point, I'm not
sure that adding it buys us much.
--
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/20140206/99d45eea/attachment-0001.sig>
More information about the libvir-list
mailing list