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

Eric Blake eblake at redhat.com
Tue Jun 14 20:41:49 UTC 2011


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 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/20110614/3f013b82/attachment-0001.sig>


More information about the libvir-list mailing list