]> xenbits.xensource.com Git - libvirt.git/commitdiff
parallels: add implicit input devices
authorDmitry Guryanov <dguryanov@parallels.com>
Tue, 7 Apr 2015 20:35:10 +0000 (23:35 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Apr 2015 07:50:30 +0000 (09:50 +0200)
Add implicit input devices in parallelsLoadDomains,
when VNC is enabled.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
src/parallels/parallels_sdk.c

index b18b6101719d9402f42e97d553432224ef6db538..d1998987fed8a9d81074563f01441b289c354190 100644 (file)
@@ -1312,6 +1312,21 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
     if (virDomainDefAddImplicitControllers(def) < 0)
         goto error;
 
+    if (def->ngraphics > 0) {
+        int bus = IS_CT(def) ? VIR_DOMAIN_INPUT_BUS_PARALLELS:
+                                VIR_DOMAIN_INPUT_BUS_PS2;
+
+        if (virDomainDefMaybeAddInput(def,
+                                      VIR_DOMAIN_INPUT_TYPE_MOUSE,
+                                      bus) < 0)
+            goto error;
+
+        if (virDomainDefMaybeAddInput(def,
+                                      VIR_DOMAIN_INPUT_TYPE_KBD,
+                                      bus) < 0)
+            goto error;
+    }
+
     if (olddom) {
         /* assign new virDomainDef without any checks */
         /* we can't use virDomainObjAssignDef, because it checks