From: Li Zhang <zhlcindy(a)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(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 2 ++
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, 17 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 5e9c65e..f963661 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -246,6 +246,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"boot-strict", /* 160 */
"pvpanic", /* 161 */
+ "usb-kbd",
);
struct _virQEMUCaps {
@@ -1398,6 +1399,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 bbf4972..fe487a0 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -200,6 +200,7 @@ enum virQEMUCapsFlags {
QEMU_CAPS_KVM_PIT_TICK_POLICY = 159, /* kvm-pit.lost_tick_policy */
QEMU_CAPS_BOOT_STRICT = 160, /* -boot strict */
QEMU_CAPS_DEVICE_PANIC = 161, /* -device pvpanic */
+ QEMU_CAPS_DEVICE_USB_KBD = 162, /*-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 73a561d..b620341 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
@@ -112,4 +112,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.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 1e5bb74..7548fb9 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
@@ -134,4 +134,5 @@
<flag name='boot-strict'/>
<flag name='pvpanic'/>
<flag name='reboot-timeout'/>
+ <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 c7ce591..e6504f5 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -138,4 +138,5 @@
<flag name='boot-strict'/>
<flag name='pvpanic'/>
<flag name='reboot-timeout'/>
+ <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 ba64177..a5f1f55 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -137,4 +137,5 @@
<flag name='boot-strict'/>
<flag name='pvpanic'/>
<flag name='reboot-timeout'/>
+ <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