]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_conf: fix migration/managedsave with usb keyboard
authorPavel Hrdina <phrdina@redhat.com>
Fri, 6 May 2016 11:55:15 +0000 (13:55 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 6 May 2016 13:42:38 +0000 (15:42 +0200)
Commin 36785c7e refactored the code for input devices but introduced a
bug where we removed all keyboard from migratable XML.  We have to
remove only implicit keyboards like PS2 or XEN.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/domain_conf.c

index 11fe721be5ad4c604b81c418029379a3592e26d4..7c2cfcf9873a3d0edd51ea7ea8d4cdc3877bea3e 100644 (file)
@@ -21196,8 +21196,10 @@ virDomainInputDefFormat(virBufferPtr buf,
     const char *bus = virDomainInputBusTypeToString(def->bus);
 
     /* don't format keyboard into migratable XML for backward compatibility */
-    if (def->type == VIR_DOMAIN_INPUT_TYPE_KBD &&
-        flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE)
+    if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
+        def->type == VIR_DOMAIN_INPUT_TYPE_KBD &&
+        (def->bus == VIR_DOMAIN_INPUT_BUS_PS2 ||
+         def->bus == VIR_DOMAIN_INPUT_BUS_XEN))
         return 0;
 
     if (!type) {