Merge lp:~serge-hallyn/ubuntu/natty/qemu-kvm/fix-mouse into lp:ubuntu/natty/qemu-kvm

Proposed by Serge Hallyn
Status: Merged
Merged at revision: 97
Proposed branch: lp:~serge-hallyn/ubuntu/natty/qemu-kvm/fix-mouse
Merge into: lp:ubuntu/natty/qemu-kvm
Diff against target: 140 lines (+120/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/2000-vmmouse-adapt-to-mouse-handler-changes.patch (+112/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/natty/qemu-kvm/fix-mouse
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+40935@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-11-10 16:05:14 +0000
3+++ debian/changelog 2010-11-16 07:25:00 +0000
4@@ -1,3 +1,10 @@
5+qemu-kvm (0.13.0+noroms-0ubuntu3) natty; urgency=low
6+
7+ * Apply 'vmmouse: adapt to mouse handler changes.' from upstream to
8+ make mouse work again, LP: #675749.
9+
10+ -- Serge Hallyn <serge.hallyn@canonical.com> Mon, 15 Nov 2010 21:34:37 -0600
11+
12 qemu-kvm (0.13.0+noroms-0ubuntu2) natty; urgency=low
13
14 * debian/control: fix broken install/upgrades of kvm, LP: #673559,
15
16=== added file 'debian/patches/2000-vmmouse-adapt-to-mouse-handler-changes.patch'
17--- debian/patches/2000-vmmouse-adapt-to-mouse-handler-changes.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/2000-vmmouse-adapt-to-mouse-handler-changes.patch 2010-11-16 07:25:00 +0000
19@@ -0,0 +1,112 @@
20+commit cd496926155afcb3b6323e70dd720dc118b3a255
21+Author: Gerd Hoffmann <kraxel@redhat.com>
22+Date: Fri Oct 8 12:30:13 2010 +0200
23+
24+ vmmouse: adapt to mouse handler changes.
25+
26+ This patch updates the vmmouse handler registration and activation.
27+
28+ Old behavior:
29+ vmmouse_read_id, vmmouse_request_relative and vmmouse_request_absolute
30+ unregister the handler and re-register it.
31+
32+ New behavior:
33+ vmmouse_request_relative and vmmouse_request_absolute will unregister
34+ the handler in case the mode did change. Then register and active the
35+ handler with current mode if needed.
36+
37+ Note that the old code never ever *activates* the handler, so the
38+ vmmouse doesn't receive events. This trips up Fedora 14 for example:
39+ Boot a default install without usb tablet, watch the X-Server activating
40+ the vmmouse then, enjoy a non-functional mouse.
41+
42+ Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
43+ Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
44+
45+diff --git a/hw/vmmouse.c b/hw/vmmouse.c
46+index f359304..2097119 100644
47+--- a/hw/vmmouse.c
48++++ b/hw/vmmouse.c
49+@@ -100,16 +100,29 @@ static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int buttons_
50+ i8042_isa_mouse_fake_event(s->ps2_mouse);
51+ }
52+
53+-static void vmmouse_update_handler(VMMouseState *s)
54++static void vmmouse_remove_handler(VMMouseState *s)
55+ {
56+ if (s->entry) {
57+ qemu_remove_mouse_event_handler(s->entry);
58+ s->entry = NULL;
59+ }
60+- if (s->status == 0)
61++}
62++
63++static void vmmouse_update_handler(VMMouseState *s, int absolute)
64++{
65++ if (s->status != 0) {
66++ return;
67++ }
68++ if (s->absolute != absolute) {
69++ s->absolute = absolute;
70++ vmmouse_remove_handler(s);
71++ }
72++ if (s->entry == NULL) {
73+ s->entry = qemu_add_mouse_event_handler(vmmouse_mouse_event,
74+ s, s->absolute,
75+ "vmmouse");
76++ qemu_activate_mouse_event_handler(s->entry);
77++ }
78+ }
79+
80+ static void vmmouse_read_id(VMMouseState *s)
81+@@ -121,28 +134,25 @@ static void vmmouse_read_id(VMMouseState *s)
82+
83+ s->queue[s->nb_queue++] = VMMOUSE_VERSION;
84+ s->status = 0;
85+- vmmouse_update_handler(s);
86+ }
87+
88+ static void vmmouse_request_relative(VMMouseState *s)
89+ {
90+ DPRINTF("vmmouse_request_relative()\n");
91+- s->absolute = 0;
92+- vmmouse_update_handler(s);
93++ vmmouse_update_handler(s, 0);
94+ }
95+
96+ static void vmmouse_request_absolute(VMMouseState *s)
97+ {
98+ DPRINTF("vmmouse_request_absolute()\n");
99+- s->absolute = 1;
100+- vmmouse_update_handler(s);
101++ vmmouse_update_handler(s, 1);
102+ }
103+
104+ static void vmmouse_disable(VMMouseState *s)
105+ {
106+ DPRINTF("vmmouse_disable()\n");
107+ s->status = 0xffff;
108+- vmmouse_update_handler(s);
109++ vmmouse_remove_handler(s);
110+ }
111+
112+ static void vmmouse_data(VMMouseState *s, uint32_t *data, uint32_t size)
113+@@ -154,7 +164,7 @@ static void vmmouse_data(VMMouseState *s, uint32_t *data, uint32_t size)
114+ if (size == 0 || size > 6 || size > s->nb_queue) {
115+ printf("vmmouse: driver requested too much data %d\n", size);
116+ s->status = 0xffff;
117+- vmmouse_update_handler(s);
118++ vmmouse_remove_handler(s);
119+ return;
120+ }
121+
122+@@ -239,7 +249,8 @@ static int vmmouse_post_load(void *opaque, int version_id)
123+ {
124+ VMMouseState *s = opaque;
125+
126+- vmmouse_update_handler(s);
127++ vmmouse_remove_handler(s);
128++ vmmouse_update_handler(s, s->absolute);
129+ return 0;
130+ }
131+
132
133=== modified file 'debian/patches/series'
134--- debian/patches/series 2010-11-02 14:22:44 +0000
135+++ debian/patches/series 2010-11-16 07:25:00 +0000
136@@ -3,3 +3,4 @@
137 larger_default_ram_size.patch
138 Detect-and-use-GCC-atomic-builtins-for-locking.patch
139 1000-undo-earlier-static.patch
140+2000-vmmouse-adapt-to-mouse-handler-changes.patch

Subscribers

People subscribed via source and target branches

to all changes: