Re: [PATCH 05/10 V2] [PATCH 05/13] send-key: Defining the public API

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

 



On 06/07/2011 03:11 AM, Lai Jiangshan wrote:
> Add public virDomainSendKey() and enum libvirt_keycode_set
> for the @codeset.
> 
> +int virDomainSendKey(virDomainPtr domain,
> +                     unsigned int codeset,
> +                     unsigned int holdtime,
> +                     unsigned int *keycodes,
> +                     unsigned int nkeycodes,
> +                     unsigned int flags);

Sorry for not noticing sooner, but ALL other public APIs that pass
array/len parameter pairs use 'int nfoo' or 'int maxfoo' for the lengthh
parameter name.  This is the first API that passes unsigned int.  While
that is technically more correct from the ABI perspective (since arrays
can never be negative length), it doesn't make much sense to be
inconsistent.

Either we should change ALL existing APIs to use 'unsigned int' in
reference to array lengths (probably a safe change, even for C++ code,
since our declarations are extern "C" and the two types are ABI
compatible), or we should change just this API to use 'int' instead of
'unsigned int' for nkeycodes.

Either way, now is the time to make the change, before we hit freeze for
0.9.3.  Preferences?

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]