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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]