[libvirt] [PATCH v9 0/7] Support keyboard device

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> This patchset is to add keyboard input device. For PPC64, it doesn't support a default keyboard device when the graphic is enabled. Libvirt supports QEMU command line as "-device VGA" which won't create any keyboard device for it. So it requires libvirt to add a default USB keyboard device for it. This patchset is to add keyboard input device and a default USB keyboard for PPC64. The related discussion in QEMU community: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg01734.html Li Zhang (7): conf: Add one interface to add default input devices conf: Add a keyboard input device type conf: Remove the implicit PS2 devices for non-X86 platforms qemu_cap: Add USB keyboard capability qemu: format qemu command line for USB keyboard xen: format xen command line for USB keyboard Add a default USB keyboard and USB mouse for PPC64 v9 -> v8: * Move keyboard XML format to the first patch. (Jan Tomko) * Correct one logic error. (Jan Tomko) v8 -> v7: * Add USB keyboard output XML format when VIR_DOMAIN_XML_MIGRATABLE isn't set. (Daniel P. && Jan Tomko) * Fix test cases because of XML changes. v7 -> v6: * Corret indention errors in code. (Jan Tomko) * Correct make check error in xen driver. (Jan Tomko) * Split 5/6 to 2 parts, qemu and xen. (Jan Tomko) v6 -> v5: * Change kbd to keyboard, and correct -usbdevice parameter. * Remove implicit PS/2 keyboard output in XML in case older libvirtd can read it. (Jan Tomko) * Remove implicit keyboard for XEN to make it safer. v5 -> v4: * Add PS/2 KBD definition in XML file. (Daniel.P.Berrange) * Allow PS/2 KBD devices and set KBD default bus as PS2 for X86, USB for non-x86. (Daniel.P.Berrange) * Add an implicit PS/2 KBD as PS/2 mouse. (Danniel.P.Berrange) v4 -> v3: * Don't remove PS2 mouse device for other virtualization drivers (Jan Tomko). v3 -> v2: * Handle the KBD device type in xen and QEMU driver. (Daniel.P.Berrange) * Remove PS2 mouse device for non-X86 platforms. * Move virDomainDefMaybeAddInput to a new patch. (Jan Tomko) * Replace VIR_REALLOC_N with VIR_APPEND_ELEMENT. (Jan Tomoko) * Fix several typos. (Jan Tomoko) * Add a virReportError when QEMU_CAPS_DEVICE_USB_KBD can't be gotten. (Jan Tomoko) v2 -> v1: * change ifs to switch clause. * reconstruct the patches docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 116 ++++++++++++++------- src/conf/domain_conf.h | 5 + src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 3 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 41 ++++++-- src/qemu/qemu_domain.c | 23 +++- src/util/virarch.h | 2 + src/xenxs/xen_sxpr.c | 27 +++-- src/xenxs/xen_xm.c | 30 ++++-- tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + tests/qemuhelptest.c | 8 ++ ...qemuhotplug-console-compat-2+console-virtio.xml | 1 + .../qemuxml2argv-console-compat-2.xml | 1 + .../qemuxml2argv-graphics-listen-network.xml | 1 + .../qemuxml2argv-graphics-listen-network2.xml | 1 + .../qemuxml2argv-graphics-sdl-fullscreen.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 1 + .../qemuxml2argv-graphics-spice-compression.xml | 1 + .../qemuxml2argv-graphics-spice-qxl-vga.xml | 1 + .../qemuxml2argv-graphics-spice-timeout.xml | 2 + .../qemuxml2argv-graphics-spice.xml | 1 + .../qemuxml2argv-graphics-vnc-policy.xml | 1 + .../qemuxml2argv-graphics-vnc-sasl.xml | 1 + .../qemuxml2argv-graphics-vnc-socket.xml | 1 + .../qemuxml2argv-graphics-vnc-tls.xml | 1 + .../qemuxml2argv-graphics-vnc-websocket.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml | 1 + .../qemuxml2argv-net-bandwidth.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 3 +- .../qemuxml2argv-pseries-usb-kbd.args | 9 ++ .../qemuxml2argv-pseries-usb-kbd.xml | 19 ++++ .../qemuxml2argv-serial-spiceport.xml | 1 + tests/qemuxml2argvtest.c | 3 + .../qemuxml2xmlout-graphics-listen-network2.xml | 1 + .../qemuxml2xmlout-graphics-spice-timeout.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 45 files changed, 256 insertions(+), 66 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml -- 1.8.2.1

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> This patch is to add one new interface to add input devices. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 29 +++++++++++++++++++++++++++++ src/conf/domain_conf.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 34 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fc9615f..1c24440 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11050,6 +11050,35 @@ virDomainDefMaybeAddController(virDomainDefPtr def, } + +int +virDomainDefMaybeAddInput(virDomainDefPtr def, + int type, + int bus) +{ + size_t i; + virDomainInputDefPtr input; + + for (i = 0; i < def->ninputs; i++) { + if (def->inputs[i]->type == type && + def->inputs[i]->bus == bus) + return 0; + } + + if (VIR_ALLOC(input) < 0) + return -1; + + input->type = type; + input->bus = bus; + + if (VIR_APPEND_ELEMENT(def->inputs, def->ninputs, input) < 0) { + VIR_FREE(input); + return -1; + } + + return 0; +} + /* Parse a memory element located at XPATH within CTXT, and store the * result into MEM. If REQUIRED, then the value must exist; * otherwise, the value is optional. The value is in blocks of 1024. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 24cbec3..b8cfee9 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2805,6 +2805,10 @@ virDomainDefMaybeAddController(virDomainDefPtr def, int type, int idx, int model); +int +virDomainDefMaybeAddInput(virDomainDefPtr def, + int type, + int bus); char *virDomainDefGetDefaultEmulator(virDomainDefPtr def, virCapsPtr caps); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 67d20ed..e560a21 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -165,6 +165,7 @@ virDomainDefGenSecurityLabelDef; virDomainDefGetDefaultEmulator; virDomainDefGetSecurityLabelDef; virDomainDefMaybeAddController; +virDomainDefMaybeAddInput; virDomainDefNew; virDomainDefParseFile; virDomainDefParseNode; -- 1.8.2.1

On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
This patch is to add one new interface to add input devices.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 29 +++++++++++++++++++++++++++++ src/conf/domain_conf.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 34 insertions(+)
ACK with the following whitespace changes and with the hunk using this function moved from 2/7 here: Jan diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 794153d..939b423 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11051,11 +11051,10 @@ virDomainDefMaybeAddController(virDomainDefPtr def, } - int virDomainDefMaybeAddInput(virDomainDefPtr def, - int type, - int bus) + int type, + int bus) { size_t i; virDomainInputDefPtr input; @@ -11080,6 +11079,7 @@ virDomainDefMaybeAddInput(virDomainDefPtr def, return 0; } + /* Parse a memory element located at XPATH within CTXT, and store the * result into MEM. If REQUIRED, then the value must exist; * otherwise, the value is optional. The value is in blocks of 1024. @@ -12493,25 +12493,15 @@ virDomainDefParseXML(xmlDocPtr xml, /* If graphics are enabled, there's an implicit PS2 mouse */ if (def->ngraphics > 0) { - virDomainInputDefPtr input; + int input_bus = VIR_DOMAIN_INPUT_BUS_XEN; - if (VIR_ALLOC(input) < 0) { - goto error; - } - if (STREQ(def->os.type, "hvm")) { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_PS2; - } else { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_XEN; - } + if (STREQ(def->os.type, "hvm")) + input_bus = VIR_DOMAIN_INPUT_BUS_PS2; - if (VIR_REALLOC_N(def->inputs, def->ninputs + 1) < 0) { - virDomainInputDefFree(input); + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_MOUSE, + input_bus) < 0) goto error; - } - def->inputs[def->ninputs] = input; - def->ninputs++; }

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> There is no keyboard support currently in libvirt . For some platforms, it needs to add a USB keyboard when graphics are enabled. This patch is to add keyboard input device type. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 70 ++++++++++++---------- src/conf/domain_conf.h | 1 + ...qemuhotplug-console-compat-2+console-virtio.xml | 1 + .../qemuxml2argv-console-compat-2.xml | 1 + .../qemuxml2argv-graphics-listen-network.xml | 1 + .../qemuxml2argv-graphics-listen-network2.xml | 1 + .../qemuxml2argv-graphics-sdl-fullscreen.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 1 + .../qemuxml2argv-graphics-spice-compression.xml | 1 + .../qemuxml2argv-graphics-spice-qxl-vga.xml | 1 + .../qemuxml2argv-graphics-spice-timeout.xml | 2 + .../qemuxml2argv-graphics-spice.xml | 1 + .../qemuxml2argv-graphics-vnc-policy.xml | 1 + .../qemuxml2argv-graphics-vnc-sasl.xml | 1 + .../qemuxml2argv-graphics-vnc-socket.xml | 1 + .../qemuxml2argv-graphics-vnc-tls.xml | 1 + .../qemuxml2argv-graphics-vnc-websocket.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml | 1 + .../qemuxml2argv-net-bandwidth.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 1 + .../qemuxml2argv-serial-spiceport.xml | 1 + .../qemuxml2xmlout-graphics-listen-network2.xml | 1 + .../qemuxml2xmlout-graphics-spice-timeout.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 27 files changed, 66 insertions(+), 31 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index c1efcd2..601e7ac 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3269,6 +3269,7 @@ <choice> <value>tablet</value> <value>mouse</value> + <value>keyboard</value> </choice> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1c24440..c475d87 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -506,7 +506,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", - "tablet") + "tablet", + "keyboard") VIR_ENUM_IMPL(virDomainInputBus, VIR_DOMAIN_INPUT_BUS_LAST, "ps2", @@ -7772,7 +7773,7 @@ error: /* Parse the XML definition for an input device */ static virDomainInputDefPtr -virDomainInputDefParseXML(const char *ostype, +virDomainInputDefParseXML(const virDomainDef *dom, xmlNodePtr node, unsigned int flags) { @@ -7805,9 +7806,10 @@ virDomainInputDefParseXML(const char *ostype, goto error; } - if (STREQ(ostype, "hvm")) { - if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* Only allow mouse for ps2 */ - def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE) { + if (STREQ(dom->os.type, "hvm")) { + if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* PS2 can be mouse or keyboard */ + !(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); @@ -7825,7 +7827,8 @@ virDomainInputDefParseXML(const char *ostype, _("unsupported input bus %s"), bus); } - if (def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE) { + if (def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE && + def->type != VIR_DOMAIN_INPUT_TYPE_KBD) { virReportError(VIR_ERR_INTERNAL_ERROR, _("xen bus does not support %s input device"), type); @@ -7833,8 +7836,9 @@ virDomainInputDefParseXML(const char *ostype, } } } else { - if (STREQ(ostype, "hvm")) { - if (def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE) + if (STREQ(dom->os.type, "hvm")) { + if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -9856,7 +9860,7 @@ virDomainDeviceDefParse(const char *xmlStr, goto error; break; case VIR_DOMAIN_DEVICE_INPUT: - if (!(dev->data.input = virDomainInputDefParseXML(def->os.type, + if (!(dev->data.input = virDomainInputDefParseXML(def, node, flags))) goto error; break; @@ -12441,7 +12445,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; for (i = 0; i < n; i++) { - virDomainInputDefPtr input = virDomainInputDefParseXML(def->os.type, + virDomainInputDefPtr input = virDomainInputDefParseXML(def, nodes[i], flags); if (!input) @@ -12461,10 +12465,12 @@ virDomainDefParseXML(xmlDocPtr xml, * XXX will this be true for other virt types ? */ if ((STREQ(def->os.type, "hvm") && input->bus == VIR_DOMAIN_INPUT_BUS_PS2 && - input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE) || + (input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + input->type == VIR_DOMAIN_INPUT_TYPE_KBD)) || (STRNEQ(def->os.type, "hvm") && input->bus == VIR_DOMAIN_INPUT_BUS_XEN && - input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE)) { + (input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + input->type == VIR_DOMAIN_INPUT_TYPE_KBD))) { virDomainInputDefFree(input); continue; } @@ -12491,29 +12497,26 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes); /* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { - virDomainInputDefPtr input; + if (def->ngraphics > 0) { + int input_bus = VIR_DOMAIN_INPUT_BUS_XEN; - if (VIR_ALLOC(input) < 0) { - goto error; - } - if (STREQ(def->os.type, "hvm")) { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_PS2; - } else { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_XEN; - } + if (STREQ(def->os.type, "hvm")) + input_bus = VIR_DOMAIN_INPUT_BUS_PS2; - if (VIR_REALLOC_N(def->inputs, def->ninputs + 1) < 0) { - virDomainInputDefFree(input); + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_MOUSE, + input_bus) < 0) goto error; + + /*Ignore keyboard for XEN, only add a PS2 keyboard device for hvm*/ + if (STREQ(def->os.type, "hvm")) { + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + input_bus) < 0) + goto error; } - def->inputs[def->ninputs] = input; - def->ninputs++; } - /* analysis of the sound devices */ if ((n = virXPathNodeSet("./devices/sound", ctxt, &nodes)) < 0) { goto error; @@ -17529,17 +17532,22 @@ virDomainDefFormatInternal(virDomainDefPtr def, } if (def->ngraphics > 0) { - /* If graphics is enabled, add the implicit mouse */ + /* If graphics is enabled, add the implicit mouse/keyboard */ virDomainInputDef autoInput = { VIR_DOMAIN_INPUT_TYPE_MOUSE, STREQ(def->os.type, "hvm") ? VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, { .alias = NULL }, }; - if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) goto error; + if (!(flags & VIR_DOMAIN_XML_MIGRATABLE)) { + autoInput.type = VIR_DOMAIN_INPUT_TYPE_KBD; + if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) + goto error; + } + for (n = 0; n < def->ngraphics; n++) if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0) goto error; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b8cfee9..009df13 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1239,6 +1239,7 @@ struct _virDomainTPMDef { enum virDomainInputType { VIR_DOMAIN_INPUT_TYPE_MOUSE, VIR_DOMAIN_INPUT_TYPE_TABLET, + VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_LAST }; diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml index d75af19..a484e82 100644 --- a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml +++ b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml @@ -104,6 +104,7 @@ <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml index 37e8e00..065ef2d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml @@ -99,6 +99,7 @@ <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml index b005440..98b7d6a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml @@ -23,6 +23,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no'> <listen type='network' network='Bobsnetwork'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml index 870ef55..aa458d7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml @@ -22,6 +22,7 @@ <controller type='usb' index='0'/> <controller type='ide' index='0'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' listen='1.2.3.4' autoport='yes'> <listen type='address' address='1.2.3.4'/> <listen type='network' network='Bobsnetwork'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml index 7793161..4aa385c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority' fullscreen='yes'/> <video> <model type='cirrus' vram='9216' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml index 26fe28b..66ea35d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority'/> <video> <model type='vga' vram='9216' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 5da94c2..6c913b4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml @@ -23,6 +23,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> <image compression='auto_glz'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml index 99d2996..acf3019 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml @@ -23,6 +23,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> <channel name='main' mode='secure'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index f9fdf37..341322c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -71,7 +71,9 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> + <input type='keyboard' bus='ps2'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index c2b5095..8f58149 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -23,6 +23,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1' defaultMode='secure'> <listen type='address' address='127.0.0.1'/> <channel name='main' mode='secure'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml index 6c95c8a..0198930 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='no' listen='127.0.0.1' sharePolicy='allow-exclusive'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml index 75563df..eda2e87 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml index 24c7eed..2b13865 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' socket='/tmp/foo.socket'/> <video> <model type='cirrus' vram='9216' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml index 75563df..eda2e87 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml index dd0bb57..11e5a7a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml @@ -17,6 +17,7 @@ <controller type='usb' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='no' websocket='5700' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml index 6dcd076..267876f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml @@ -24,6 +24,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='2001:1:2:3:4:5:1234:1234'> <listen type='address' address='2001:1:2:3:4:5:1234:1234'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml index 0df46c6..a19fe4f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml @@ -22,6 +22,7 @@ <controller type='usb' index='0'/> <controller type='ide' index='0'/> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml index 4b8646d..064a05f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml @@ -60,6 +60,7 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml index eb20328..a1cb38c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml @@ -196,6 +196,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index dbbd6aa..05e0f63 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -31,6 +31,7 @@ <controller type='scsi' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='sdl'/> <video> <model type='cirrus' vram='9216' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 1e42ee6..36af468 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml @@ -32,6 +32,7 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml index 3f7c383..ae40805 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml @@ -23,6 +23,7 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='1.2.3.4'> <listen type='address' address='1.2.3.4'/> <listen type='network' network='Bobsnetwork'/> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml index f793f62..44c4cf7 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml @@ -74,6 +74,7 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> diff --git a/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml b/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml index 28af543..a9122be 100644 --- a/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml +++ b/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml @@ -12,6 +12,7 @@ <on_crash>destroy</on_crash> <devices> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='de' passwd='password'/> <video> <model type='vmvga' vram='4096'/> -- 1.8.2.1

On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
There is no keyboard support currently in libvirt . For some platforms, it needs to add a USB keyboard when graphics are enabled.
This patch is to add keyboard input device type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 70 ++++++++++++---------- src/conf/domain_conf.h | 1 + ... tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 27 files changed, 66 insertions(+), 31 deletions(-)
This fails 'make check' for me: FAIL: sexpr2xmltest FAIL: xmconfigtest
@@ -7805,9 +7806,10 @@ virDomainInputDefParseXML(const char *ostype, goto error; }
- if (STREQ(ostype, "hvm")) { - if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* Only allow mouse for ps2 */ - def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE) { + if (STREQ(dom->os.type, "hvm")) { + if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* PS2 can be mouse or keyboard */ + !(def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) {
This is easier to read as: def->type != MOUSE && def->type != KBD
virReportError(VIR_ERR_INTERNAL_ERROR, _("ps2 bus does not support %s input device"), type);
@@ -7833,8 +7836,9 @@ virDomainInputDefParseXML(const char *ostype, } } } else { - if (STREQ(ostype, "hvm")) { - if (def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE) + if (STREQ(dom->os.type, "hvm")) { + if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + def->type == VIR_DOMAIN_INPUT_TYPE_KBD))
Trailing space breaks 'make syntax-check'
def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB;
@@ -12491,29 +12497,26 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes);
/* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { - virDomainInputDefPtr input; + if (def->ngraphics > 0) {
Another trailing space.
+ int input_bus = VIR_DOMAIN_INPUT_BUS_XEN;
- if (VIR_ALLOC(input) < 0) { - goto error; - } - if (STREQ(def->os.type, "hvm")) { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_PS2; - } else { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_XEN; - } + if (STREQ(def->os.type, "hvm")) + input_bus = VIR_DOMAIN_INPUT_BUS_PS2;
- if (VIR_REALLOC_N(def->inputs, def->ninputs + 1) < 0) { - virDomainInputDefFree(input); + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_MOUSE, + input_bus) < 0) goto error; + + /*Ignore keyboard for XEN, only add a PS2 keyboard device for hvm*/ + if (STREQ(def->os.type, "hvm")) {
Xen has "hvm" domains too, and since we were adding the mouse for non-hvm domains, I think we should get rid of this condition and add keyboards too (I think this is different from what I said earlier)
+ if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + input_bus) < 0) + goto error; } - def->inputs[def->ninputs] = input; - def->ninputs++; }
- /* analysis of the sound devices */ if ((n = virXPathNodeSet("./devices/sound", ctxt, &nodes)) < 0) { goto error;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index f9fdf37..341322c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -71,7 +71,9 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> + <input type='keyboard' bus='ps2'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound>
Double keyboard entry. ACK with this squashed in: diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5031441..75b87d1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7808,9 +7808,9 @@ virDomainInputDefParseXML(const virDomainDef *dom, } if (STREQ(dom->os.type, "hvm")) { - if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* PS2 can be mouse or keyboard */ - !(def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) { + if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && + 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); @@ -7839,7 +7839,7 @@ virDomainInputDefParseXML(const virDomainDef *dom, } else { if (STREQ(dom->os.type, "hvm")) { if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) + def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -12498,7 +12498,7 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes); /* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { + if (def->ngraphics > 0) { int input_bus = VIR_DOMAIN_INPUT_BUS_XEN; if (STREQ(def->os.type, "hvm")) @@ -12509,13 +12509,10 @@ virDomainDefParseXML(xmlDocPtr xml, input_bus) < 0) goto error; - /*Ignore keyboard for XEN, only add a PS2 keyboard device for hvm*/ - if (STREQ(def->os.type, "hvm")) { - if (virDomainDefMaybeAddInput(def, - VIR_DOMAIN_INPUT_TYPE_KBD, - input_bus) < 0) - goto error; - } + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + input_bus) < 0) + goto error; } /* analysis of the sound devices */ @@ -17540,6 +17537,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, { .alias = NULL }, }; + if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) goto error; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index 341322c..e6ecbed 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -73,7 +73,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> - <input type='keyboard' bus='ps2'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> diff --git a/tests/sexpr2xmldata/sexpr2xml-curmem.xml b/tests/sexpr2xmldata/sexpr2xml-curmem.xml index 1edc52b..2e68fc4 100644 --- a/tests/sexpr2xmldata/sexpr2xml-curmem.xml +++ b/tests/sexpr2xmldata/sexpr2xml-curmem.xml @@ -31,6 +31,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml index 9883a4b..0f29f03 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml @@ -43,6 +43,7 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5925' autoport='yes' keymap='en-us'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml index d5b0f23..b5bd19b 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml index ae45357..ae056c8 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml @@ -39,6 +39,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml index c502ff3..27090be 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml @@ -39,6 +39,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml index 837b97f..b896e51 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml index ad2e212..8dda7ff 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml @@ -37,6 +37,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml index a70b005..788d319 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml @@ -37,6 +37,7 @@ <model type='netfront'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml index 1c667cc..a9450ec 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml @@ -41,6 +41,7 @@ <target port='0'/> </parallel> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml index 8938ee3..f05db8d 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml index 96062cf..10a331e 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml @@ -44,6 +44,7 @@ <target type='serial' port='1'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml index 3dcd7e7..c1c717e 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml index 301c3ee..ea19144 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml index e6e6e5d..447d4a3 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml index f2e7952..328bc45 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml index 9a4e1cb..5a92433 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml index 4ba84cd..1f800bc 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml index 11f7daa..23dabbd 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml index 90c89f3..29ba6e5 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml index b67df0f..0379e0d 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml index ba0f7e1..0785041 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> <sound model='sb16'/> <sound model='es1370'/> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml index ba0f7e1..0785041 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> <sound model='sb16'/> <sound model='es1370'/> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml index 6a7bec4..b9c2aaf 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml @@ -37,6 +37,7 @@ </interface> <input type='mouse' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml index 31fbeea..44a0867 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml @@ -37,6 +37,7 @@ </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml index 3da882b..584fbfb 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml index 7bbe780..f910412 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv.xml b/tests/sexpr2xmldata/sexpr2xml-fv.xml index 3da882b..584fbfb 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml index 1cd5d68..055b0d3 100644 --- a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml +++ b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml @@ -41,6 +41,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml index 74d4316..e8c3cda 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml index d6b81bf..365d3c9 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml index d6b81bf..365d3c9 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml index 6f22dd4..5333292 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml @@ -29,6 +29,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/xmconfigdata/test-escape-paths.xml b/tests/xmconfigdata/test-escape-paths.xml index 40c9b3e..de3a7e2 100644 --- a/tests/xmconfigdata/test-escape-paths.xml +++ b/tests/xmconfigdata/test-escape-paths.xml @@ -43,6 +43,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-force-hpet.xml b/tests/xmconfigdata/test-fullvirt-force-hpet.xml index bb74bae..75f8724 100644 --- a/tests/xmconfigdata/test-fullvirt-force-hpet.xml +++ b/tests/xmconfigdata/test-fullvirt-force-hpet.xml @@ -40,6 +40,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml index 1f45c73..e5741b6 100644 --- a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml +++ b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml @@ -40,6 +40,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-localtime.xml b/tests/xmconfigdata/test-fullvirt-localtime.xml index 2fba66e..8b97e5b 100644 --- a/tests/xmconfigdata/test-fullvirt-localtime.xml +++ b/tests/xmconfigdata/test-fullvirt-localtime.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml +++ b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-net-netfront.xml b/tests/xmconfigdata/test-fullvirt-net-netfront.xml index bba4ae5..177bb6a 100644 --- a/tests/xmconfigdata/test-fullvirt-net-netfront.xml +++ b/tests/xmconfigdata/test-fullvirt-net-netfront.xml @@ -38,6 +38,7 @@ <model type='netfront'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml +++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml index 78c8a88..a592630 100644 --- a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml +++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml index 2b52e03..738e5ab 100644 --- a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml +++ b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml @@ -43,6 +43,7 @@ <target port='0'/> </parallel> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml index af38ee5..753831a 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml @@ -50,6 +50,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml index 93cf83d..1a55080 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml @@ -46,6 +46,7 @@ <target type='serial' port='1'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-file.xml b/tests/xmconfigdata/test-fullvirt-serial-file.xml index 6d51f71..0d2ac79 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-file.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-file.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-null.xml b/tests/xmconfigdata/test-fullvirt-serial-null.xml index 59bac70..d4b4ae9 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-null.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-null.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml index dd8ffbc..6596dfc 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-pty.xml b/tests/xmconfigdata/test-fullvirt-serial-pty.xml index 9561ca2..6c55abb 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-pty.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-pty.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml index 4fb6908..461f143 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml index ba2ae7e..d2fa7bf 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml index a47b4e8..60ab8bd 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-udp.xml b/tests/xmconfigdata/test-fullvirt-serial-udp.xml index e939229..6c21cd2 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-udp.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-udp.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-unix.xml b/tests/xmconfigdata/test-fullvirt-serial-unix.xml index 3166e70..f21534e 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-unix.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-unix.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-sound.xml b/tests/xmconfigdata/test-fullvirt-sound.xml index 3011a47..f09c16d 100644 --- a/tests/xmconfigdata/test-fullvirt-sound.xml +++ b/tests/xmconfigdata/test-fullvirt-sound.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-usbmouse.xml b/tests/xmconfigdata/test-fullvirt-usbmouse.xml index 26fbae5..18a7ff0 100644 --- a/tests/xmconfigdata/test-fullvirt-usbmouse.xml +++ b/tests/xmconfigdata/test-fullvirt-usbmouse.xml @@ -39,6 +39,7 @@ </interface> <input type='mouse' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-usbtablet.xml b/tests/xmconfigdata/test-fullvirt-usbtablet.xml index 7e2e6c7..5cbb007 100644 --- a/tests/xmconfigdata/test-fullvirt-usbtablet.xml +++ b/tests/xmconfigdata/test-fullvirt-usbtablet.xml @@ -39,6 +39,7 @@ </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-utc.xml b/tests/xmconfigdata/test-fullvirt-utc.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-utc.xml +++ b/tests/xmconfigdata/test-fullvirt-utc.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-no-source-cdrom.xml b/tests/xmconfigdata/test-no-source-cdrom.xml index 697ba2f..2a457b2 100644 --- a/tests/xmconfigdata/test-no-source-cdrom.xml +++ b/tests/xmconfigdata/test-no-source-cdrom.xml @@ -43,6 +43,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.xml b/tests/xmconfigdata/test-paravirt-net-e1000.xml index 4fa2a2d..3466344 100644 --- a/tests/xmconfigdata/test-paravirt-net-e1000.xml +++ b/tests/xmconfigdata/test-paravirt-net-e1000.xml @@ -28,6 +28,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-net-vifname.xml b/tests/xmconfigdata/test-paravirt-net-vifname.xml index 2a93918..20d96aa 100644 --- a/tests/xmconfigdata/test-paravirt-net-vifname.xml +++ b/tests/xmconfigdata/test-paravirt-net-vifname.xml @@ -29,6 +29,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml index 4ee8329..c02963d 100644 --- a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml +++ b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.xml b/tests/xmconfigdata/test-paravirt-new-pvfb.xml index 1b3a05a..ee25550 100644 --- a/tests/xmconfigdata/test-paravirt-new-pvfb.xml +++ b/tests/xmconfigdata/test-paravirt-new-pvfb.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml index 4ee8329..c02963d 100644 --- a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml +++ b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.xml b/tests/xmconfigdata/test-paravirt-old-pvfb.xml index 1b3a05a..ee25550 100644 --- a/tests/xmconfigdata/test-paravirt-old-pvfb.xml +++ b/tests/xmconfigdata/test-paravirt-old-pvfb.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-pci-devs.xml b/tests/xmconfigdata/test-pci-devs.xml index 89a7490..f828056 100644 --- a/tests/xmconfigdata/test-pci-devs.xml +++ b/tests/xmconfigdata/test-pci-devs.xml @@ -43,6 +43,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <hostdev mode='subsystem' type='pci' managed='no'> <source>

On 2014年02月18日 20:51, Ján Tomko wrote:
On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
There is no keyboard support currently in libvirt . For some platforms, it needs to add a USB keyboard when graphics are enabled.
This patch is to add keyboard input device type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 70 ++++++++++++---------- src/conf/domain_conf.h | 1 + ... tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 27 files changed, 66 insertions(+), 31 deletions(-)
This fails 'make check' for me: FAIL: sexpr2xmltest FAIL: xmconfigtest
Ah, I can't get any errors when doing 'make check' on my side. :(
@@ -7805,9 +7806,10 @@ virDomainInputDefParseXML(const char *ostype, goto error; }
- if (STREQ(ostype, "hvm")) { - if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* Only allow mouse for ps2 */ - def->type != VIR_DOMAIN_INPUT_TYPE_MOUSE) { + if (STREQ(dom->os.type, "hvm")) { + if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* PS2 can be mouse or keyboard */ + !(def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) { This is easier to read as: def->type != MOUSE && def->type != KBD
virReportError(VIR_ERR_INTERNAL_ERROR, _("ps2 bus does not support %s input device"), type); @@ -7833,8 +7836,9 @@ virDomainInputDefParseXML(const char *ostype, } } } else { - if (STREQ(ostype, "hvm")) { - if (def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE) + if (STREQ(dom->os.type, "hvm")) { + if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || + def->type == VIR_DOMAIN_INPUT_TYPE_KBD))
Trailing space breaks 'make syntax-check'
def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -12491,29 +12497,26 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes);
/* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { - virDomainInputDefPtr input; + if (def->ngraphics > 0) {
Another trailing space.
+ int input_bus = VIR_DOMAIN_INPUT_BUS_XEN;
- if (VIR_ALLOC(input) < 0) { - goto error; - } - if (STREQ(def->os.type, "hvm")) { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_PS2; - } else { - input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - input->bus = VIR_DOMAIN_INPUT_BUS_XEN; - } + if (STREQ(def->os.type, "hvm")) + input_bus = VIR_DOMAIN_INPUT_BUS_PS2;
- if (VIR_REALLOC_N(def->inputs, def->ninputs + 1) < 0) { - virDomainInputDefFree(input); + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_MOUSE, + input_bus) < 0) goto error; + + /*Ignore keyboard for XEN, only add a PS2 keyboard device for hvm*/ + if (STREQ(def->os.type, "hvm")) { Xen has "hvm" domains too, and since we were adding the mouse for non-hvm domains, I think we should get rid of this condition and add keyboards too (I think this is different from what I said earlier)
+ if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + input_bus) < 0) + goto error; } - def->inputs[def->ninputs] = input; - def->ninputs++; }
- /* analysis of the sound devices */ if ((n = virXPathNodeSet("./devices/sound", ctxt, &nodes)) < 0) { goto error; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index f9fdf37..341322c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -71,7 +71,9 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> + <input type='keyboard' bus='ps2'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> Double keyboard entry.
ACK with this squashed in:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5031441..75b87d1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7808,9 +7808,9 @@ virDomainInputDefParseXML(const virDomainDef *dom, }
if (STREQ(dom->os.type, "hvm")) { - if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && /* PS2 can be mouse or keyboard */ - !(def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) { + if (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 && + 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); @@ -7839,7 +7839,7 @@ virDomainInputDefParseXML(const virDomainDef *dom, } else { if (STREQ(dom->os.type, "hvm")) { if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) + def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -12498,7 +12498,7 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes);
/* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { + if (def->ngraphics > 0) { int input_bus = VIR_DOMAIN_INPUT_BUS_XEN;
if (STREQ(def->os.type, "hvm")) @@ -12509,13 +12509,10 @@ virDomainDefParseXML(xmlDocPtr xml, input_bus) < 0) goto error;
- /*Ignore keyboard for XEN, only add a PS2 keyboard device for hvm*/ - if (STREQ(def->os.type, "hvm")) { - if (virDomainDefMaybeAddInput(def, - VIR_DOMAIN_INPUT_TYPE_KBD, - input_bus) < 0) - goto error; - } + if (virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + input_bus) < 0) + goto error; }
/* analysis of the sound devices */ @@ -17540,6 +17537,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, { .alias = NULL }, }; + if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) goto error;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index 341322c..e6ecbed 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -73,7 +73,6 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> - <input type='keyboard' bus='ps2'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> diff --git a/tests/sexpr2xmldata/sexpr2xml-curmem.xml b/tests/sexpr2xmldata/sexpr2xml-curmem.xml index 1edc52b..2e68fc4 100644 --- a/tests/sexpr2xmldata/sexpr2xml-curmem.xml +++ b/tests/sexpr2xmldata/sexpr2xml-curmem.xml @@ -31,6 +31,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml index 9883a4b..0f29f03 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml @@ -43,6 +43,7 @@ </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5925' autoport='yes' keymap='en-us'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml index d5b0f23..b5bd19b 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml index ae45357..ae056c8 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml @@ -39,6 +39,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml index c502ff3..27090be 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml @@ -39,6 +39,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml index 837b97f..b896e51 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml index ad2e212..8dda7ff 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml @@ -37,6 +37,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml index a70b005..788d319 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml @@ -37,6 +37,7 @@ <model type='netfront'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml index 1c667cc..a9450ec 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml @@ -41,6 +41,7 @@ <target port='0'/> </parallel> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml index 8938ee3..f05db8d 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml index 96062cf..10a331e 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml @@ -44,6 +44,7 @@ <target type='serial' port='1'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml index 3dcd7e7..c1c717e 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml index 301c3ee..ea19144 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml index e6e6e5d..447d4a3 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml index f2e7952..328bc45 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml index 9a4e1cb..5a92433 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml @@ -42,6 +42,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml index 4ba84cd..1f800bc 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml index 11f7daa..23dabbd 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml index 90c89f3..29ba6e5 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml index b67df0f..0379e0d 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='no'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml index ba0f7e1..0785041 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> <sound model='sb16'/> <sound model='es1370'/> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml index ba0f7e1..0785041 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> <sound model='sb16'/> <sound model='es1370'/> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml index 6a7bec4..b9c2aaf 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml @@ -37,6 +37,7 @@ </interface> <input type='mouse' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml index 31fbeea..44a0867 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml @@ -37,6 +37,7 @@ </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml index 3da882b..584fbfb 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml index 7bbe780..f910412 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-fv.xml b/tests/sexpr2xmldata/sexpr2xml-fv.xml index 3da882b..584fbfb 100644 --- a/tests/sexpr2xmldata/sexpr2xml-fv.xml +++ b/tests/sexpr2xmldata/sexpr2xml-fv.xml @@ -36,6 +36,7 @@ <target dev='vif3.0'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' keymap='ja'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml index 1cd5d68..055b0d3 100644 --- a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml +++ b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml @@ -41,6 +41,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml index 74d4316..e8c3cda 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml index d6b81bf..365d3c9 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml index d6b81bf..365d3c9 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml @@ -24,6 +24,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'> <listen type='address' address='0.0.0.0'/> </graphics> diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml index 6f22dd4..5333292 100644 --- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml +++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml @@ -29,6 +29,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/xmconfigdata/test-escape-paths.xml b/tests/xmconfigdata/test-escape-paths.xml index 40c9b3e..de3a7e2 100644 --- a/tests/xmconfigdata/test-escape-paths.xml +++ b/tests/xmconfigdata/test-escape-paths.xml @@ -43,6 +43,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-force-hpet.xml b/tests/xmconfigdata/test-fullvirt-force-hpet.xml index bb74bae..75f8724 100644 --- a/tests/xmconfigdata/test-fullvirt-force-hpet.xml +++ b/tests/xmconfigdata/test-fullvirt-force-hpet.xml @@ -40,6 +40,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml index 1f45c73..e5741b6 100644 --- a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml +++ b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml @@ -40,6 +40,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-localtime.xml b/tests/xmconfigdata/test-fullvirt-localtime.xml index 2fba66e..8b97e5b 100644 --- a/tests/xmconfigdata/test-fullvirt-localtime.xml +++ b/tests/xmconfigdata/test-fullvirt-localtime.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml +++ b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-net-netfront.xml b/tests/xmconfigdata/test-fullvirt-net-netfront.xml index bba4ae5..177bb6a 100644 --- a/tests/xmconfigdata/test-fullvirt-net-netfront.xml +++ b/tests/xmconfigdata/test-fullvirt-net-netfront.xml @@ -38,6 +38,7 @@ <model type='netfront'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml +++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml index 78c8a88..a592630 100644 --- a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml +++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml index 2b52e03..738e5ab 100644 --- a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml +++ b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml @@ -43,6 +43,7 @@ <target port='0'/> </parallel> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml index af38ee5..753831a 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml @@ -50,6 +50,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml index 93cf83d..1a55080 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml @@ -46,6 +46,7 @@ <target type='serial' port='1'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-file.xml b/tests/xmconfigdata/test-fullvirt-serial-file.xml index 6d51f71..0d2ac79 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-file.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-file.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-null.xml b/tests/xmconfigdata/test-fullvirt-serial-null.xml index 59bac70..d4b4ae9 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-null.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-null.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml index dd8ffbc..6596dfc 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-pty.xml b/tests/xmconfigdata/test-fullvirt-serial-pty.xml index 9561ca2..6c55abb 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-pty.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-pty.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml index 4fb6908..461f143 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml @@ -44,6 +44,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml index ba2ae7e..d2fa7bf 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml index a47b4e8..60ab8bd 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-udp.xml b/tests/xmconfigdata/test-fullvirt-serial-udp.xml index e939229..6c21cd2 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-udp.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-udp.xml @@ -48,6 +48,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-serial-unix.xml b/tests/xmconfigdata/test-fullvirt-serial-unix.xml index 3166e70..f21534e 100644 --- a/tests/xmconfigdata/test-fullvirt-serial-unix.xml +++ b/tests/xmconfigdata/test-fullvirt-serial-unix.xml @@ -46,6 +46,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-sound.xml b/tests/xmconfigdata/test-fullvirt-sound.xml index 3011a47..f09c16d 100644 --- a/tests/xmconfigdata/test-fullvirt-sound.xml +++ b/tests/xmconfigdata/test-fullvirt-sound.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-usbmouse.xml b/tests/xmconfigdata/test-fullvirt-usbmouse.xml index 26fbae5..18a7ff0 100644 --- a/tests/xmconfigdata/test-fullvirt-usbmouse.xml +++ b/tests/xmconfigdata/test-fullvirt-usbmouse.xml @@ -39,6 +39,7 @@ </interface> <input type='mouse' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-usbtablet.xml b/tests/xmconfigdata/test-fullvirt-usbtablet.xml index 7e2e6c7..5cbb007 100644 --- a/tests/xmconfigdata/test-fullvirt-usbtablet.xml +++ b/tests/xmconfigdata/test-fullvirt-usbtablet.xml @@ -39,6 +39,7 @@ </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-fullvirt-utc.xml b/tests/xmconfigdata/test-fullvirt-utc.xml index d34368e..f22c085 100644 --- a/tests/xmconfigdata/test-fullvirt-utc.xml +++ b/tests/xmconfigdata/test-fullvirt-utc.xml @@ -38,6 +38,7 @@ <model type='e1000'/> </interface> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-no-source-cdrom.xml b/tests/xmconfigdata/test-no-source-cdrom.xml index 697ba2f..2a457b2 100644 --- a/tests/xmconfigdata/test-no-source-cdrom.xml +++ b/tests/xmconfigdata/test-no-source-cdrom.xml @@ -43,6 +43,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.xml b/tests/xmconfigdata/test-paravirt-net-e1000.xml index 4fa2a2d..3466344 100644 --- a/tests/xmconfigdata/test-paravirt-net-e1000.xml +++ b/tests/xmconfigdata/test-paravirt-net-e1000.xml @@ -28,6 +28,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-net-vifname.xml b/tests/xmconfigdata/test-paravirt-net-vifname.xml index 2a93918..20d96aa 100644 --- a/tests/xmconfigdata/test-paravirt-net-vifname.xml +++ b/tests/xmconfigdata/test-paravirt-net-vifname.xml @@ -29,6 +29,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml index 4ee8329..c02963d 100644 --- a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml +++ b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.xml b/tests/xmconfigdata/test-paravirt-new-pvfb.xml index 1b3a05a..ee25550 100644 --- a/tests/xmconfigdata/test-paravirt-new-pvfb.xml +++ b/tests/xmconfigdata/test-paravirt-new-pvfb.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml index 4ee8329..c02963d 100644 --- a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml +++ b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.xml b/tests/xmconfigdata/test-paravirt-old-pvfb.xml index 1b3a05a..ee25550 100644 --- a/tests/xmconfigdata/test-paravirt-old-pvfb.xml +++ b/tests/xmconfigdata/test-paravirt-old-pvfb.xml @@ -27,6 +27,7 @@ <target type='xen' port='0'/> </console> <input type='mouse' bus='xen'/> + <input type='keyboard' bus='xen'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'> <listen type='address' address='127.0.0.1'/> </graphics> diff --git a/tests/xmconfigdata/test-pci-devs.xml b/tests/xmconfigdata/test-pci-devs.xml index 89a7490..f828056 100644 --- a/tests/xmconfigdata/test-pci-devs.xml +++ b/tests/xmconfigdata/test-pci-devs.xml @@ -43,6 +43,7 @@ <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <hostdev mode='subsystem' type='pci' managed='no'> <source>

On 02/19/2014 07:22 AM, Li Zhang wrote:
On 2014年02月18日 20:51, Ján Tomko wrote:
On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
There is no keyboard support currently in libvirt . For some platforms, it needs to add a USB keyboard when graphics are enabled.
This patch is to add keyboard input device type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 70 ++++++++++++---------- src/conf/domain_conf.h | 1 + ... tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 27 files changed, 66 insertions(+), 31 deletions(-)
This fails 'make check' for me: FAIL: sexpr2xmltest FAIL: xmconfigtest
Ah, I can't get any errors when doing 'make check' on my side. :(
Libvirt needs to be built --with-xen for those tests to work. You probably don't have the xen library headers on your system. Jan

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> PS2 device only works for X86 platform, other platforms may need USB devices instead. Athough it doesn't influence the QEMU command line, but it's not right to add PS2 mouse/keyboard for non-X86 platform. So, this patch is to remove PS2 devices for non-x86 platforms. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 31 +++++++++++++--------- src/util/virarch.h | 2 ++ .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 -- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c475d87..935255d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7838,7 +7838,8 @@ virDomainInputDefParseXML(const virDomainDef *dom, } else { if (STREQ(dom->os.type, "hvm")) { if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) + def->type == VIR_DOMAIN_INPUT_TYPE_KBD) && + ARCH_IS_X86(dom->os.arch)) def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -12497,7 +12498,8 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes); /* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { + if (def->ngraphics > 0 && + ARCH_IS_X86(def->os.arch)) { int input_bus = VIR_DOMAIN_INPUT_BUS_XEN; if (STREQ(def->os.type, "hvm")) @@ -17533,19 +17535,22 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (def->ngraphics > 0) { /* If graphics is enabled, add the implicit mouse/keyboard */ - virDomainInputDef autoInput = { - VIR_DOMAIN_INPUT_TYPE_MOUSE, - STREQ(def->os.type, "hvm") ? - VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, - { .alias = NULL }, - }; - if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) - goto error; - - if (!(flags & VIR_DOMAIN_XML_MIGRATABLE)) { - autoInput.type = VIR_DOMAIN_INPUT_TYPE_KBD; + if ((ARCH_IS_X86(def->os.arch)) || + def->os.arch == VIR_ARCH_NONE) { + virDomainInputDef autoInput = { + VIR_DOMAIN_INPUT_TYPE_MOUSE, + STREQ(def->os.type, "hvm") ? + VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, + { .alias = NULL }, + }; if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) goto error; + + if (!(flags & VIR_DOMAIN_XML_MIGRATABLE)) { + autoInput.type = VIR_DOMAIN_INPUT_TYPE_KBD; + if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) + goto error; + } } for (n = 0; n < def->ngraphics; n++) diff --git a/src/util/virarch.h b/src/util/virarch.h index b180400..c4d67ce 100644 --- a/src/util/virarch.h +++ b/src/util/virarch.h @@ -70,6 +70,8 @@ typedef enum { VIR_ARCH_LAST, } virArch; +# define ARCH_IS_X86(arch) ((arch) == VIR_ARCH_X86_64 ||\ + (arch) == VIR_ARCH_I686) typedef enum { VIR_ARCH_LITTLE_ENDIAN, diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 05e0f63..8dde776 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -30,8 +30,6 @@ <controller type='usb' index='0'/> <controller type='scsi' index='0'/> <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> <graphics type='sdl'/> <video> <model type='cirrus' vram='9216' heads='1'/> -- 1.8.2.1

On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
PS2 device only works for X86 platform, other platforms may need USB devices instead. Athough it doesn't influence the QEMU command line, but it's not right to add PS2 mouse/keyboard for non-X86 platform.
So, this patch is to remove PS2 devices for non-x86 platforms.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 31 +++++++++++++--------- src/util/virarch.h | 2 ++ .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 -- 3 files changed, 20 insertions(+), 15 deletions(-)
ACK with this squashed in: diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 86ac997..2826847 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7840,10 +7840,11 @@ virDomainInputDefParseXML(const virDomainDef *dom, if (STREQ(dom->os.type, "hvm")) { if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || def->type == VIR_DOMAIN_INPUT_TYPE_KBD) && - ARCH_IS_X86(dom->os.arch)) + (ARCH_IS_X86(dom->os.arch) || dom->os.arch == VIR_ARCH_NONE)) { def->bus = VIR_DOMAIN_INPUT_BUS_PS2; - else + } else { def->bus = VIR_DOMAIN_INPUT_BUS_USB; + } } else { def->bus = VIR_DOMAIN_INPUT_BUS_XEN; } @@ -12500,7 +12501,7 @@ virDomainDefParseXML(xmlDocPtr xml, /* If graphics are enabled, there's an implicit PS2 mouse */ if (def->ngraphics > 0 && - ARCH_IS_X86(def->os.arch)) { + (ARCH_IS_X86(def->os.arch) || def->os.arch == VIR_ARCH_NONE)) { int input_bus = VIR_DOMAIN_INPUT_BUS_XEN; if (STREQ(def->os.type, "hvm")) @@ -17533,8 +17534,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (def->ngraphics > 0) { /* If graphics is enabled, add the implicit mouse/keyboard */ - if ((ARCH_IS_X86(def->os.arch)) || - def->os.arch == VIR_ARCH_NONE) { + if ((ARCH_IS_X86(def->os.arch)) || def->os.arch == VIR_ARCH_NONE) { virDomainInputDef autoInput = { VIR_DOMAIN_INPUT_TYPE_MOUSE, STREQ(def->os.type, "hvm") ?

On 2014年02月17日 18:17, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
PS2 device only works for X86 platform, other platforms may need USB devices instead. Athough it doesn't influence the QEMU command line, but it's not right to add PS2 mouse/keyboard for non-X86 platform.
So, this patch is to remove PS2 devices for non-x86 platforms.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 31 +++++++++++++--------- src/util/virarch.h | 2 ++ .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 -- 3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c475d87..935255d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7838,7 +7838,8 @@ virDomainInputDefParseXML(const virDomainDef *dom, } else { if (STREQ(dom->os.type, "hvm")) { if ((def->type == VIR_DOMAIN_INPUT_TYPE_MOUSE || - def->type == VIR_DOMAIN_INPUT_TYPE_KBD)) + def->type == VIR_DOMAIN_INPUT_TYPE_KBD) && + ARCH_IS_X86(dom->os.arch)) ^^^^^^^^^^^^^^^ Sorry, there is a trailing space. It needs to remove it when applying the patch.
def->bus = VIR_DOMAIN_INPUT_BUS_PS2; else def->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -12497,7 +12498,8 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes);
/* If graphics are enabled, there's an implicit PS2 mouse */ - if (def->ngraphics > 0) { + if (def->ngraphics > 0 && + ARCH_IS_X86(def->os.arch)) {
^^^^^^^^^^^^^^^^ This line is also has a trailing space.
int input_bus = VIR_DOMAIN_INPUT_BUS_XEN;
if (STREQ(def->os.type, "hvm")) @@ -17533,19 +17535,22 @@ virDomainDefFormatInternal(virDomainDefPtr def,
if (def->ngraphics > 0) { /* If graphics is enabled, add the implicit mouse/keyboard */ - virDomainInputDef autoInput = { - VIR_DOMAIN_INPUT_TYPE_MOUSE, - STREQ(def->os.type, "hvm") ? - VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, - { .alias = NULL }, - }; - if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) - goto error; - - if (!(flags & VIR_DOMAIN_XML_MIGRATABLE)) { - autoInput.type = VIR_DOMAIN_INPUT_TYPE_KBD; + if ((ARCH_IS_X86(def->os.arch)) || + def->os.arch == VIR_ARCH_NONE) { + virDomainInputDef autoInput = { + VIR_DOMAIN_INPUT_TYPE_MOUSE, + STREQ(def->os.type, "hvm") ? + VIR_DOMAIN_INPUT_BUS_PS2 : VIR_DOMAIN_INPUT_BUS_XEN, + { .alias = NULL }, + }; if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) goto error; + + if (!(flags & VIR_DOMAIN_XML_MIGRATABLE)) { + autoInput.type = VIR_DOMAIN_INPUT_TYPE_KBD; + if (virDomainInputDefFormat(buf, &autoInput, flags) < 0) + goto error; + } }
for (n = 0; n < def->ngraphics; n++) diff --git a/src/util/virarch.h b/src/util/virarch.h index b180400..c4d67ce 100644 --- a/src/util/virarch.h +++ b/src/util/virarch.h @@ -70,6 +70,8 @@ typedef enum { VIR_ARCH_LAST, } virArch;
+# define ARCH_IS_X86(arch) ((arch) == VIR_ARCH_X86_64 ||\ + (arch) == VIR_ARCH_I686)
typedef enum { VIR_ARCH_LITTLE_ENDIAN, diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 05e0f63..8dde776 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -30,8 +30,6 @@ <controller type='usb' index='0'/> <controller type='scsi' index='0'/> <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> <graphics type='sdl'/> <video> <model type='cirrus' vram='9216' heads='1'/>

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> QEMU can support USB keyboard but libvirt haven't supportted it yet. This patch is to add USB keyboard capabilities and test cases. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + tests/qemuhelptest.c | 8 ++++++++ 9 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e7d953a..d618b3f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -249,6 +249,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "enable-fips", "spice-file-xfer-disable", "spiceport", + + "usb-kbd", /* 165 */ ); struct _virQEMUCaps { @@ -1403,6 +1405,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-mmio", QEMU_CAPS_DEVICE_VIRTIO_MMIO }, { "ich9-intel-hda", QEMU_CAPS_DEVICE_ICH9_INTEL_HDA }, { "pvpanic", QEMU_CAPS_DEVICE_PANIC }, + { "usb-kbd", QEMU_CAPS_DEVICE_USB_KBD }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index a4eecb6..b5445e7 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -203,6 +203,7 @@ enum virQEMUCapsFlags { QEMU_CAPS_ENABLE_FIPS = 162, /* -enable-fips */ QEMU_CAPS_SPICE_FILE_XFER_DISABLE = 163, /* -spice disable-agent-file-xfer */ QEMU_CAPS_CHARDEV_SPICEPORT = 164, /* -chardev spiceport */ + QEMU_CAPS_DEVICE_USB_KBD = 165, /* -device usb-kbd */ QEMU_CAPS_LAST, /* this must always be the last item */ }; diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps index c3ae814..436cecd 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps @@ -113,4 +113,5 @@ <flag name='usb-storage.removable'/> <flag name='kvm-pit-lost-tick-policy'/> <flag name='enable-fips'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps index da15d8b..6b4a8f0 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps @@ -126,4 +126,5 @@ <flag name='usb-storage'/> <flag name='usb-storage.removable'/> <flag name='kvm-pit-lost-tick-policy'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps index c419068..e3d0047 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps @@ -127,4 +127,5 @@ <flag name='usb-storage.removable'/> <flag name='ich9-intel-hda'/> <flag name='kvm-pit-lost-tick-policy'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps index adf8531..01b4d27 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps @@ -135,4 +135,5 @@ <flag name='pvpanic'/> <flag name='reboot-timeout'/> <flag name='spiceport'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps index e6b2f76..597f873 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps @@ -141,4 +141,5 @@ <flag name='enable-fips'/> <flag name='spice-file-xfer-disable'/> <flag name='spiceport'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps index e6b8117..0c1dd87 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps @@ -139,4 +139,5 @@ <flag name='reboot-timeout'/> <flag name='spice-file-xfer-disable'/> <flag name='spiceport'/> + <flag name='usb-kbd'/> </qemuCaps> diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 3628fbe..6e0a5f8 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -403,6 +403,7 @@ mymain(void) QEMU_CAPS_DEVICE_VMWARE_SVGA, QEMU_CAPS_DEVICE_USB_SERIAL, QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, QEMU_CAPS_VNC_COLON, @@ -515,6 +516,7 @@ mymain(void) QEMU_CAPS_DEVICE_USB_NET, QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_SCSI_GENERIC, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_USB_STORAGE); DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, QEMU_CAPS_VNC_COLON, @@ -581,6 +583,7 @@ mymain(void) QEMU_CAPS_DEVICE_VMWARE_SVGA, QEMU_CAPS_DEVICE_USB_SERIAL, QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, QEMU_CAPS_VNC_COLON, @@ -655,6 +658,7 @@ mymain(void) QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_USB_STORAGE); DO_TEST("qemu-1.0", 1000000, 0, 0, QEMU_CAPS_VNC_COLON, @@ -739,6 +743,7 @@ mymain(void) QEMU_CAPS_DEVICE_USB_NET, QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_USB_STORAGE); DO_TEST("qemu-1.1.0", 1001000, 0, 0, QEMU_CAPS_VNC_COLON, @@ -835,6 +840,7 @@ mymain(void) QEMU_CAPS_DEVICE_SCSI_GENERIC, QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX, QEMU_CAPS_VNC_SHARE_POLICY, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_DEVICE_USB_STORAGE); DO_TEST("qemu-1.2.0", 1002000, 0, 0, QEMU_CAPS_VNC_COLON, @@ -943,6 +949,7 @@ mymain(void) QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX, QEMU_CAPS_VNC_SHARE_POLICY, QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_USB_STORAGE_REMOVABLE); DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0, QEMU_CAPS_VNC_COLON, @@ -1056,6 +1063,7 @@ mymain(void) QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX, QEMU_CAPS_VNC_SHARE_POLICY, QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_USB_STORAGE_REMOVABLE); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -- 1.8.2.1

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> This patch is to format qemu command line for USB keyboard and add test cases for it. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 41 ++++++++++++++++------ .../qemuxml2argv-pseries-usb-kbd.args | 9 +++++ .../qemuxml2argv-pseries-usb-kbd.xml | 19 ++++++++++ tests/qemuxml2argvtest.c | 3 ++ 4 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bb8756f..22ba441 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5306,9 +5306,19 @@ qemuBuildUSBInputDevStr(virDomainDefPtr def, { virBuffer buf = VIR_BUFFER_INITIALIZER; - virBufferAsprintf(&buf, "%s,id=%s", - dev->type == VIR_DOMAIN_INPUT_TYPE_MOUSE ? - "usb-mouse" : "usb-tablet", dev->info.alias); + switch (dev->type) { + case VIR_DOMAIN_INPUT_TYPE_MOUSE: + virBufferAsprintf(&buf, "usb-mouse,id=%s", dev->info.alias); + break; + case VIR_DOMAIN_INPUT_TYPE_TABLET: + virBufferAsprintf(&buf, "usb-tablet,id=%s", dev->info.alias); + break; + case VIR_DOMAIN_INPUT_TYPE_KBD: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) + goto error; + virBufferAsprintf(&buf, "usb-kbd,id=%s", dev->info.alias); + break; + } if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0) goto error; @@ -9044,9 +9054,17 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, optstr); VIR_FREE(optstr); } else { - virCommandAddArgList(cmd, "-usbdevice", - input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE - ? "mouse" : "tablet", NULL); + switch (input->type) { + case VIR_DOMAIN_INPUT_TYPE_MOUSE: + virCommandAddArgList(cmd, "-usbdevice", "mouse", NULL); + break; + case VIR_DOMAIN_INPUT_TYPE_TABLET: + virCommandAddArgList(cmd, "-usbdevice", "tablet", NULL); + break; + case VIR_DOMAIN_INPUT_TYPE_KBD: + virCommandAddArgList(cmd, "-usbdevice", "keyboard", NULL); + break; + } } } } @@ -11720,20 +11738,23 @@ qemuParseCommandLine(virCapsPtr qemuCaps, } else if (STREQ(arg, "-usbdevice")) { WANT_VALUE(); if (STREQ(val, "tablet") || - STREQ(val, "mouse")) { + STREQ(val, "mouse") || + STREQ(val, "keyboard")) { virDomainInputDefPtr input; if (VIR_ALLOC(input) < 0) goto error; input->bus = VIR_DOMAIN_INPUT_BUS_USB; if (STREQ(val, "tablet")) input->type = VIR_DOMAIN_INPUT_TYPE_TABLET; - else + else if (STREQ(val, "mouse")) input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; - if (VIR_REALLOC_N(def->inputs, def->ninputs+1) < 0) { + else + input->type = VIR_DOMAIN_INPUT_TYPE_KBD; + + if (VIR_APPEND_ELEMENT(def->inputs, def->ninputs, input) < 0) { virDomainInputDefFree(input); goto error; } - def->inputs[def->ninputs++] = input; } else if (STRPREFIX(val, "disk:")) { if (VIR_ALLOC(disk) < 0) goto error; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args new file mode 100644 index 0000000..373c72a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args @@ -0,0 +1,9 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 \ +-nographic -nodefconfig -nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \ +-device pci-ohci,id=usb,bus=pci,addr=0x1 \ +-chardev pty,id=charserial0 \ +-device spapr-vty,chardev=charserial0,reg=0x30000000 \ +-device usb-kbd,id=input0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml new file mode 100644 index 0000000..5bd4c37 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml @@ -0,0 +1,19 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>524288</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + </os> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <console type='pty'> + <address type="spapr-vio"/> + </console> + <memballoon model="none"/> + <controller type='usb' index='0' model='pci-ohci'/> + <input type='keyboard' bus='usb'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7a5b50d..23b5652 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1206,6 +1206,9 @@ mymain(void) DO_TEST_ERROR("pseries-vio-address-clash", QEMU_CAPS_DRIVE, QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM); + DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI, + QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_CHARDEV, + QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); DO_TEST_FAILURE("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); DO_TEST("disk-ide-drive-split", QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, -- 1.8.2.1

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> This patch is to format xen command line for USB keyboard Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/xenxs/xen_sxpr.c | 27 +++++++++++++++++++-------- src/xenxs/xen_xm.c | 30 ++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index d514725..d366b1b 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -724,21 +724,23 @@ xenParseSxprUSB(virDomainDefPtr def, tmp = sexpr_node(node, "usbdevice"); if (tmp && *tmp) { if (STREQ(tmp, "tablet") || - STREQ(tmp, "mouse")) { + STREQ(tmp, "mouse") || + STREQ(tmp, "keyboard")) { virDomainInputDefPtr input; if (VIR_ALLOC(input) < 0) goto error; input->bus = VIR_DOMAIN_INPUT_BUS_USB; if (STREQ(tmp, "tablet")) input->type = VIR_DOMAIN_INPUT_TYPE_TABLET; - else + else if (STREQ(tmp, "mouse")) input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; + else + input->type = VIR_DOMAIN_INPUT_TYPE_KBD; - if (VIR_REALLOC_N(def->inputs, def->ninputs+1) < 0) { + if (VIR_APPEND_ELEMENT(def->inputs, def->ninputs, input) < 0) { VIR_FREE(input); goto error; } - def->inputs[def->ninputs++] = input; } else { /* XXX Handle other non-input USB devices later */ } @@ -2144,15 +2146,24 @@ xenFormatSxprInput(virDomainInputDefPtr input, return 0; if (input->type != VIR_DOMAIN_INPUT_TYPE_MOUSE && - input->type != VIR_DOMAIN_INPUT_TYPE_TABLET) { + input->type != VIR_DOMAIN_INPUT_TYPE_TABLET && + input->type != VIR_DOMAIN_INPUT_TYPE_KBD) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected input type %d"), input->type); return -1; } - virBufferAsprintf(buf, "(usbdevice %s)", - input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE ? - "mouse" : "tablet"); + switch (input->type) { + case VIR_DOMAIN_INPUT_TYPE_MOUSE: + virBufferAsprintf(buf, "(usbdevice %s)", "mouse"); + break; + case VIR_DOMAIN_INPUT_TYPE_TABLET: + virBufferAsprintf(buf, "(usbdevice %s)", "tablet"); + break; + case VIR_DOMAIN_INPUT_TYPE_KBD: + virBufferAsprintf(buf, "(usbdevice %s)", "keyboard"); + break; + } return 0; } diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index 5e89876..3a57547 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -886,14 +886,18 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, goto cleanup; if (str && (STREQ(str, "tablet") || - STREQ(str, "mouse"))) { + STREQ(str, "mouse") || + STREQ(str, "keyboard"))) { virDomainInputDefPtr input; if (VIR_ALLOC(input) < 0) goto cleanup; input->bus = VIR_DOMAIN_INPUT_BUS_USB; - input->type = STREQ(str, "tablet") ? - VIR_DOMAIN_INPUT_TYPE_TABLET : - VIR_DOMAIN_INPUT_TYPE_MOUSE; + if (STREQ(str, "mouse")) + input->type = VIR_DOMAIN_INPUT_TYPE_MOUSE; + else if (STREQ(str, "tablet")) + input->type = VIR_DOMAIN_INPUT_TYPE_TABLET; + else if (STREQ(str, "keyboard")) + input->type = VIR_DOMAIN_INPUT_TYPE_KBD; if (VIR_ALLOC_N(def->inputs, 1) < 0) { virDomainInputDefFree(input); goto cleanup; @@ -1746,10 +1750,20 @@ virConfPtr xenFormatXM(virConnectPtr conn, if (def->inputs[i]->bus == VIR_DOMAIN_INPUT_BUS_USB) { if (xenXMConfigSetInt(conf, "usb", 1) < 0) goto cleanup; - if (xenXMConfigSetString(conf, "usbdevice", - def->inputs[i]->type == VIR_DOMAIN_INPUT_TYPE_MOUSE ? - "mouse" : "tablet") < 0) - goto cleanup; + switch (def->inputs[i]->type) { + case VIR_DOMAIN_INPUT_TYPE_MOUSE: + if (xenXMConfigSetString(conf, "usbdevice", "mouse") < 0) + goto cleanup; + break; + case VIR_DOMAIN_INPUT_TYPE_TABLET: + if (xenXMConfigSetString(conf, "usbdevice", "tablet") < 0) + goto cleanup; + break; + case VIR_DOMAIN_INPUT_TYPE_KBD: + if (xenXMConfigSetString(conf, "usbdevice", "keyboard") < 0) + goto cleanup; + break; + } break; } } -- 1.8.2.1

On 02/17/2014 11:17 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
This patch is to format xen command line for USB keyboard
s/xen command line/Xen XM and S-Expr config/ both here and in the subject.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/xenxs/xen_sxpr.c | 27 +++++++++++++++++++-------- src/xenxs/xen_xm.c | 30 ++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 16 deletions(-)
ACK

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> There is no keyboard working on PPC64 and PS2 mouse is only for X86 when graphics are enabled. It needs to add a USB keyboard and USB mouse for PPC64. This patch is to add a USB keyboard and USB mouse when graphics are enabled. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 23 +++++++++++++++++++++- .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a665061..7f4ff0e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -691,6 +691,8 @@ qemuDomainDefPostParse(virDomainDefPtr def, bool addPCIRoot = false; bool addPCIeRoot = false; bool addDefaultMemballoon = true; + bool addDefaultUSBKBD = false; + bool addDefaultUSBMouse = false; /* check for emulator and create a default one if needed */ if (!def->emulator && @@ -732,9 +734,14 @@ qemuDomainDefPostParse(virDomainDefPtr def, addDefaultMemballoon = false; break; + case VIR_ARCH_PPC64: + addPCIRoot = true; + addDefaultUSBKBD = true; + addDefaultUSBMouse = true; + break; + case VIR_ARCH_ALPHA: case VIR_ARCH_PPC: - case VIR_ARCH_PPC64: case VIR_ARCH_PPCEMB: case VIR_ARCH_SH4: case VIR_ARCH_SH4EB: @@ -787,6 +794,20 @@ qemuDomainDefPostParse(virDomainDefPtr def, def->memballoon = memballoon; } + if (addDefaultUSBKBD && + def->ngraphics > 0 && + virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_KBD, + VIR_DOMAIN_INPUT_BUS_USB) < 0) + return -1; + + if (addDefaultUSBMouse && + def->ngraphics > 0 && + virDomainDefMaybeAddInput(def, + VIR_DOMAIN_INPUT_TYPE_MOUSE, + VIR_DOMAIN_INPUT_BUS_USB) < 0) + return -1; + return 0; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 8dde776..64b70f3 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -30,6 +30,8 @@ <controller type='usb' index='0'/> <controller type='scsi' index='0'/> <controller type='pci' index='0' model='pci-root'/> + <input type='keyboard' bus='usb'/> + <input type='mouse' bus='usb'/> <graphics type='sdl'/> <video> <model type='cirrus' vram='9216' heads='1'/> -- 1.8.2.1

Hi Jan and Daniel, Would you like to accept this patchset? Thanks. On 2014年02月17日 18:17, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
This patchset is to add keyboard input device.
For PPC64, it doesn't support a default keyboard device when the graphic is enabled. Libvirt supports QEMU command line as "-device VGA" which won't create any keyboard device for it. So it requires libvirt to add a default USB keyboard device for it.
This patchset is to add keyboard input device and a default USB keyboard for PPC64.
The related discussion in QEMU community: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg01734.html
Li Zhang (7): conf: Add one interface to add default input devices conf: Add a keyboard input device type conf: Remove the implicit PS2 devices for non-X86 platforms qemu_cap: Add USB keyboard capability qemu: format qemu command line for USB keyboard xen: format xen command line for USB keyboard Add a default USB keyboard and USB mouse for PPC64
v9 -> v8: * Move keyboard XML format to the first patch. (Jan Tomko) * Correct one logic error. (Jan Tomko)
v8 -> v7: * Add USB keyboard output XML format when VIR_DOMAIN_XML_MIGRATABLE isn't set. (Daniel P. && Jan Tomko) * Fix test cases because of XML changes.
v7 -> v6: * Corret indention errors in code. (Jan Tomko) * Correct make check error in xen driver. (Jan Tomko) * Split 5/6 to 2 parts, qemu and xen. (Jan Tomko) v6 -> v5: * Change kbd to keyboard, and correct -usbdevice parameter. * Remove implicit PS/2 keyboard output in XML in case older libvirtd can read it. (Jan Tomko) * Remove implicit keyboard for XEN to make it safer.
v5 -> v4: * Add PS/2 KBD definition in XML file. (Daniel.P.Berrange) * Allow PS/2 KBD devices and set KBD default bus as PS2 for X86, USB for non-x86. (Daniel.P.Berrange) * Add an implicit PS/2 KBD as PS/2 mouse. (Danniel.P.Berrange)
v4 -> v3: * Don't remove PS2 mouse device for other virtualization drivers (Jan Tomko).
v3 -> v2: * Handle the KBD device type in xen and QEMU driver. (Daniel.P.Berrange) * Remove PS2 mouse device for non-X86 platforms. * Move virDomainDefMaybeAddInput to a new patch. (Jan Tomko) * Replace VIR_REALLOC_N with VIR_APPEND_ELEMENT. (Jan Tomoko) * Fix several typos. (Jan Tomoko) * Add a virReportError when QEMU_CAPS_DEVICE_USB_KBD can't be gotten. (Jan Tomoko)
v2 -> v1: * change ifs to switch clause. * reconstruct the patches
docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 116 ++++++++++++++------- src/conf/domain_conf.h | 5 + src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 3 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 41 ++++++-- src/qemu/qemu_domain.c | 23 +++- src/util/virarch.h | 2 + src/xenxs/xen_sxpr.c | 27 +++-- src/xenxs/xen_xm.c | 30 ++++-- tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + tests/qemuhelptest.c | 8 ++ ...qemuhotplug-console-compat-2+console-virtio.xml | 1 + .../qemuxml2argv-console-compat-2.xml | 1 + .../qemuxml2argv-graphics-listen-network.xml | 1 + .../qemuxml2argv-graphics-listen-network2.xml | 1 + .../qemuxml2argv-graphics-sdl-fullscreen.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 1 + .../qemuxml2argv-graphics-spice-compression.xml | 1 + .../qemuxml2argv-graphics-spice-qxl-vga.xml | 1 + .../qemuxml2argv-graphics-spice-timeout.xml | 2 + .../qemuxml2argv-graphics-spice.xml | 1 + .../qemuxml2argv-graphics-vnc-policy.xml | 1 + .../qemuxml2argv-graphics-vnc-sasl.xml | 1 + .../qemuxml2argv-graphics-vnc-socket.xml | 1 + .../qemuxml2argv-graphics-vnc-tls.xml | 1 + .../qemuxml2argv-graphics-vnc-websocket.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml | 1 + .../qemuxml2argv-net-bandwidth.xml | 1 + tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 1 + .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 3 +- .../qemuxml2argv-pseries-usb-kbd.args | 9 ++ .../qemuxml2argv-pseries-usb-kbd.xml | 19 ++++ .../qemuxml2argv-serial-spiceport.xml | 1 + tests/qemuxml2argvtest.c | 3 + .../qemuxml2xmlout-graphics-listen-network2.xml | 1 + .../qemuxml2xmlout-graphics-spice-timeout.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + 45 files changed, 256 insertions(+), 66 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml

On 2014年02月18日 20:52, Ján Tomko wrote:
On 02/18/2014 09:58 AM, Li Zhang wrote:
Hi Jan and Daniel,
Would you like to accept this patchset?
Thanks.
Hi,
it looks good to me and I'd like to push it this week with the changes I pointed out, unless someone has a different opinion.
Thanks a lot.
Jan

On 02/19/2014 07:17 AM, Li Zhang wrote:
On 2014年02月18日 20:52, Ján Tomko wrote:
On 02/18/2014 09:58 AM, Li Zhang wrote:
Hi Jan and Daniel,
Would you like to accept this patchset?
Thanks.
Hi,
it looks good to me and I'd like to push it this week with the changes I pointed out, unless someone has a different opinion.
Thanks a lot.
I've pushed it now. Jan
participants (2)
-
Ján Tomko
-
Li Zhang