[PATCH v3 6/6] Add a default USB keyboard for PPC64

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

 



From: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx>

There is no keyboard working on PPC64 when graphics are enabled.
It needs to add a USB keyboard for it.

This patch is to add a USB keyboard when graphics are enabled.

Signed-off-by: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx>
---
 src/qemu/qemu_domain.c                               | 9 +++++++++
 tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 75e615a..68d9e0c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -691,6 +691,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
     bool addPCIRoot = false;
     bool addPCIeRoot = false;
     bool addDefaultMemballoon = true;
+    bool addDefaultUSBKBD = false;
     bool addDefaultMouse = false;
     int  mouse_bus = VIR_DOMAIN_INPUT_BUS_XEN;
 
@@ -735,6 +736,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
 
     case VIR_ARCH_PPC64:
         addPCIRoot = true;
+        addDefaultUSBKBD = true;
         addDefaultMouse = true;
         if (STREQ(def->os.type, "hvm"))
             mouse_bus = VIR_DOMAIN_INPUT_BUS_USB;
@@ -801,6 +803,13 @@ qemuDomainDefPostParse(virDomainDefPtr def,
             return -1;
     }
 
+    if (addDefaultUSBKBD &&
+        def->ngraphics > 0 &&
+        virDomainDefMaybeAddInput(def,
+                                  VIR_DOMAIN_INPUT_TYPE_KBD,
+                                  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 117213d..8c87998 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='usb'/>
+    <input type='kbd' bus='usb'/>
     <graphics type='sdl'/>
     <video>
       <model type='cirrus' vram='9216' heads='1'/>
-- 
1.8.2.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]