[libvirt] [libvirt-python PATCH] sanitytest: check for exported enums

Eric Blake eblake at redhat.com
Mon Oct 6 14:41:45 UTC 2014


On 10/06/2014 04:32 AM, Martin Kletzander wrote:
> We are already collecting list of enums exported and list of enums we
> want to have available.  Event hough there was an issue with one enum

s/hough/though/

> fixed with 014d9bbaf368b33a881f1d6b2fd8a5dd285a4f71, there was no test
> for it and this commit tries to fix that.
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>  sanitytest.py | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 51 insertions(+), 2 deletions(-)
> 

>  for n in set:
> +    for enumval in enumvals.values():
> +        if n in enumval:
> +            enum = enumval
> +            break
> +    # Eliminate sentinels
> +    if n.endswith('_LAST') and enum[n] == max(enum.values()):

We have one enum ending in _LAST that is not a sentinel:
VIR_NETWORK_UPDATE_COMMAND_ADD_LAST.  But it looks like you were careful
(since that sentinel is not the maximum value, you are not skipping it).

ACK.

Also, I still think we should fix libvirt to export XML that recursively
resolves all enum values down to ints, rather than making clients have
to repeat the resolution; but as that would only impact new libvirt, we
still need this code to deal with existing libvirt.

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


More information about the libvir-list mailing list