[libvirt] [PATCH 09/10 V2] send-key: Expose the new API in virsh

Eric Blake eblake at redhat.com
Tue Jun 14 19:39:34 UTC 2011


On 06/07/2011 03:11 AM, Lai Jiangshan wrote:
> +
> +    if (STREQ(codeset_option, "default") || STREQ(codeset_option, "linux")) {
> +        codeset = LIBVIRT_KEYCODE_LINUX;
> +    } else if (STREQ(codeset_option, "xt")) {
> +        codeset = LIBVIRT_KEYCODE_XT;
> +    } else if (STREQ(codeset_option, "atset1")) {
> +        codeset = LIBVIRT_KEYCODE_ATSET1;
> +    } else if (STREQ(codeset_option, "atset2")) {
> +        codeset = LIBVIRT_KEYCODE_ATSET2;
> +    } else if (STREQ(codeset_option, "atset3")) {
> +        codeset = LIBVIRT_KEYCODE_ATSET3;

This begs for a virEnum translation table which converts between strings
and enum values via a few short macro calls, rather than open-coding the
conversion.

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


More information about the libvir-list mailing list