[libvirt] [PATCH v2 6/7] qemu: Switch over command line capabilities to virBitmap

Eric Blake eblake at redhat.com
Tue Feb 22 17:40:12 UTC 2011


On 02/22/2011 09:48 AM, Jiri Denemark wrote:
> This is done for two reasons:
> - we are getting very close to 64 flags which is the maximum we can use
>   with unsigned long long
> - by using LL constants in enum we already violates C99 constraint that
>   enum values have to fit into int
> 
> ---
> Notes:
>     Version 2:
>     - rebased to current master
>     - qemuCapsFree added to a list of free-like functions in cfg.mk
>     - don't fail qemuCapsParseHelpStr() if there is no memory for bitmap
>       string used for a debug message

Nice changes.

> +++ b/cfg.mk
> @@ -135,7 +135,8 @@ useless_free_options =				\
>    --name=virThreadPoolFree			\
>    --name=xmlFree				\
>    --name=xmlXPathFreeContext			\
> -  --name=xmlXPathFreeObject
> +  --name=xmlXPathFreeObject			\
> +  --name=qemuCapsFree

This list is sorted; can you reshuffle the lines to stick it in just
before sexpr_free instead?

> @@ -1029,10 +1029,13 @@ int qemuCapsParseHelpStr(const char *qemu,
>  
>      *version = (major * 1000 * 1000) + (minor * 1000) + micro;
>  
> -    *flags = qemuCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version);
> +    qemuCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version, flags);
> +
> +    strflags = virBitmapString(flags);
> +    VIR_DEBUG("Version %u.%u.%u, cooked version %u, flags %s",
> +              major, minor, micro, *version, NULLSTR(strflags));
> +    VIR_FREE(strflags);
>
> -    VIR_DEBUG("Version %u.%u.%u, cooked version %u, flags 0x%llx",
> -              major, minor, micro, *version, *flags);

Yeah, that's better than v1.

ACK with the cfg.mk nit fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list