[libvirt] [PATCH 1/7] libvirt.h: consolidate typed parameter handling

Eric Blake eblake at redhat.com
Wed May 18 14:45:43 UTC 2011


On 05/18/2011 02:11 AM, Daniel Veillard wrote:
>>>>  typedef enum {
>>>> -    VIR_DOMAIN_SCHED_FIELD_INT     = 1, /* integer case */
>>>> -    VIR_DOMAIN_SCHED_FIELD_UINT    = 2, /* unsigned integer case */
>>>> -    VIR_DOMAIN_SCHED_FIELD_LLONG   = 3, /* long long case */
>>>> -    VIR_DOMAIN_SCHED_FIELD_ULLONG  = 4, /* unsigned long long case */
>>>> -    VIR_DOMAIN_SCHED_FIELD_DOUBLE  = 5, /* double case */
>>>> -    VIR_DOMAIN_SCHED_FIELD_BOOLEAN = 6  /* boolean(character) case */
>>>> +    VIR_DOMAIN_SCHED_FIELD_INT     = VIR_TYPED_PARAM_INT,
>>>> +    VIR_DOMAIN_SCHED_FIELD_UINT    = VIR_TYPED_PARAM_UINT,
>>>> +    VIR_DOMAIN_SCHED_FIELD_LLONG   = VIR_TYPED_PARAM_LLONG,
>>>> +    VIR_DOMAIN_SCHED_FIELD_ULLONG  = VIR_TYPED_PARAM_ULLONG,
>>>> +    VIR_DOMAIN_SCHED_FIELD_DOUBLE  = VIR_TYPED_PARAM_DOUBLE,
>>>> +    VIR_DOMAIN_SCHED_FIELD_BOOLEAN = VIR_TYPED_PARAM_BOOLEAN,
>>>>  } virSchedParameterType;
>>>
>>> Can we remove VIR_DOMAIN_SCHED_FIELD_XXX and use VIR_TYPED_PARAM_XXX
>>> directly since parameter types are basically types like int, long, ...
>>> and don't depend on what parameters are?

No, but I could do a followup patch that moves the old names to the
bottom of the file along with a comment that they are old names; as well
as clean up the rest of the code to use the new (shorter) names
consistently.

> Patch looks fine to me, and we should do that cleanup before the next
> release !
> 
>  ACK,

Thanks; I've pushed this one as-is.  New interfaces that follow the same
paradigm can use the new type without having to create wrapper names
(for example, I know that the net_cls cgroup controller has some
name/value pairs worth exposing through libvirt someday).

-- 
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/20110518/20ec77b4/attachment-0001.sig>


More information about the libvir-list mailing list