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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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