From 31f6f67aac01c70c25f09f7e0169dbbd73dbb2a6 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Mon, 9 Aug 2010 14:30:17 -0400
Subject: [PATCH] Restore 'tablet mouse on vnc' behavior

We needed to revert commit 5b062a58ac76b39c2dc6a7e1543affdf43dc7ee7
because it was in conflict with the usb_mouse hv parameter. Here we
reintroduce its functionality only when usb_mouse is not specified.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/hypervisor/hv_kvm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
index 748eb5d22..f6520a95f 100644
--- a/lib/hypervisor/hv_kvm.py
+++ b/lib/hypervisor/hv_kvm.py
@@ -508,11 +508,14 @@ class KVMHypervisor(hv_base.BaseHypervisor):
       kvm_cmd.extend(['-append', ' '.join(root_append)])
 
     mouse_type = hvp[constants.HV_USB_MOUSE]
+    vnc_bind_address = hvp[constants.HV_VNC_BIND_ADDRESS]
+
     if mouse_type:
       kvm_cmd.extend(['-usb'])
       kvm_cmd.extend(['-usbdevice', mouse_type])
+    elif vnc_bind_address:
+      kvm_cmd.extend(['-usbdevice', constants.HT_MOUSE_TABLET])
 
-    vnc_bind_address = hvp[constants.HV_VNC_BIND_ADDRESS]
     if vnc_bind_address:
       if utils.IsValidIP(vnc_bind_address):
         if instance.network_port > constants.VNC_BASE_PORT:
-- 
GitLab