[libvirt] [PATCH v5 1/6] conf: Add a keyboard input device type

Ján Tomko jtomko at redhat.com
Mon Feb 3 15:09:07 UTC 2014


On 12/19/2013 08:50 AM, Li Zhang wrote:
> From: Li Zhang <zhlcindy at linux.vnet.ibm.com>
> 
> There is no keyboard for non-x86 platforms when graphics are enabled.
> It's preferred to add one USB keyboard.
> 
> This patch is to add keyboard input device type.
> 
> Signed-off-by: Li Zhang <zhlcindy at linux.vnet.ibm.com>
> ---
>  docs/schemas/domaincommon.rng |  1 +
>  src/conf/domain_conf.c        | 18 ++++++++++++------
>  src/conf/domain_conf.h        |  1 +
>  3 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index be32c6b..df6253c 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -3167,6 +3167,7 @@
>          <choice>
>            <value>tablet</value>
>            <value>mouse</value>
> +          <value>kbd</value>
>          </choice>
>        </attribute>
>        <optional>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 0079234..9c30a78 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -505,7 +505,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
>  
>  VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST,
>                "mouse",
> -              "tablet")
> +              "tablet",
> +              "kbd")

Maybe "keyboard" would sound nicer?

>  
>  VIR_ENUM_IMPL(virDomainInputBus, VIR_DOMAIN_INPUT_BUS_LAST,
>                "ps2",
> @@ -7659,7 +7660,8 @@ virDomainInputDefParseXML(const char *ostype,
>  
>          if (STREQ(ostype, "hvm")) {
>              if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* Only allow mouse for ps2 */

The comment is no longer true.

> -                def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE) {
> +                !(def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE ||
> +                def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) {
>                  virReportError(VIR_ERR_INTERNAL_ERROR,
>                                 _("ps2 bus does not support %s input device"),
>                                 type);

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140203/93b1b5ae/attachment-0001.sig>


More information about the libvir-list mailing list