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

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



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 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]