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

Re: [libvirt] [PATCH v9 3/7] conf: Remove the implicit PS2 devices for non-X86 platforms



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") ?


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