diff mbox

hw/vmmouse.c: Fix to disable vmmouse after reboot

Message ID alpine.LFD.2.02.1201041752270.17663@bbs.intern
State New
Headers show

Commit Message

Gerhard Wiesinger Jan. 4, 2012, 4:54 p.m. UTC
Bugfix after reboot when vmmouse was enabled and another OS which uses e.g. PS/2
mouse.

Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com>
---
  hw/vmmouse.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Andreas Färber Jan. 4, 2012, 5:10 p.m. UTC | #1
Am 04.01.2012 17:54, schrieb Gerhard Wiesinger:
> Bugfix after reboot when vmmouse was enabled and another OS which uses
> e.g. PS/2
> mouse.

Could you please be a bit more verbose on what symptoms that fixes?

Thanks,
Andreas

> 
> Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com>
> ---
>  hw/vmmouse.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/vmmouse.c b/hw/vmmouse.c
> index 1113f33..f9f5b53 100644
> --- a/hw/vmmouse.c
> +++ b/hw/vmmouse.c
> @@ -254,6 +254,8 @@ static void vmmouse_reset(DeviceState *d)
> 
>      s->status = 0xffff;
>      s->queue_size = VMMOUSE_QUEUE_SIZE;
> +
> +    vmmouse_disable(s);
>  }
> 
>  static int vmmouse_initfn(ISADevice *dev)
Gerhard Wiesinger Jan. 4, 2012, 5:25 p.m. UTC | #2
Testscenario:
1.) Boot e.g. OS with VMMouse support (e.g. Windows)
2.) reboot
3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse doesn't 
work any more. Fixes that issue.

Reason is that VMMouse has priority and disables all other mouse 
entities and therefore must be disabled on reset.

Ciao,
Gerhard

--
http://www.wiesinger.com/


On Wed, 4 Jan 2012, Andreas Färber wrote:

> Am 04.01.2012 17:54, schrieb Gerhard Wiesinger:
>> Bugfix after reboot when vmmouse was enabled and another OS which uses
>> e.g. PS/2
>> mouse.
>
> Could you please be a bit more verbose on what symptoms that fixes?
>
> Thanks,
> Andreas
>
>>
>> Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com>
>> ---
>>  hw/vmmouse.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/vmmouse.c b/hw/vmmouse.c
>> index 1113f33..f9f5b53 100644
>> --- a/hw/vmmouse.c
>> +++ b/hw/vmmouse.c
>> @@ -254,6 +254,8 @@ static void vmmouse_reset(DeviceState *d)
>>
>>      s->status = 0xffff;
>>      s->queue_size = VMMOUSE_QUEUE_SIZE;
>> +
>> +    vmmouse_disable(s);
>>  }
>>
>>  static int vmmouse_initfn(ISADevice *dev)
>
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
>
>
>
Gerhard Wiesinger Jan. 8, 2012, 12:01 p.m. UTC | #3
On Wed, 4 Jan 2012, Gerhard Wiesinger wrote:

> Testscenario:
> 1.) Boot e.g. OS with VMMouse support (e.g. Windows)
> 2.) reboot
> 3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse doesn't 
> work any more. Fixes that issue.
>
> Reason is that VMMouse has priority and disables all other mouse entities and 
> therefore must be disabled on reset.

Any further comments before integrating the patch?

Ciao,
Gerhard

--
http://www.wiesinger.com/
Andreas Färber Jan. 8, 2012, 4:31 p.m. UTC | #4
Am 08.01.2012 13:01, schrieb Gerhard Wiesinger:
> On Wed, 4 Jan 2012, Gerhard Wiesinger wrote:
> 
>> Testscenario:
>> 1.) Boot e.g. OS with VMMouse support (e.g. Windows)
>> 2.) reboot
>> 3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse
>> doesn't work any more. Fixes that issue.
>>
>> Reason is that VMMouse has priority and disables all other mouse
>> entities and therefore must be disabled on reset.
> 
> Any further comments before integrating the patch?

I implicitly asked you for a more verbose commit message.

For example, based on the info you provided as a reply above:

--8<--
hw/vmmouse.c: Disable vmmouse on reboot

When a guest activated the vmmouse, following a reboot the vmmouse
stayed enabled and the PS/2 mouse was unusable. That way, when rebooting
to guests without vmmouse support the mouse would not work.

Fix this by disabling the vmmouse in its reset handler.
--8<--

I have it queued for testing tomorrow - I am hoping this will fix a
0.15.1 mouse issue after kdump as well.

As a bugfix, it would definitely be a candidate for stable-1.0.

Andreas
Andreas Färber Jan. 12, 2012, 6:37 p.m. UTC | #5
Am 08.01.2012 17:31, schrieb Andreas Färber:
> Am 08.01.2012 13:01, schrieb Gerhard Wiesinger:
>> On Wed, 4 Jan 2012, Gerhard Wiesinger wrote:
>>
>>> Testscenario:
>>> 1.) Boot e.g. OS with VMMouse support (e.g. Windows)
>>> 2.) reboot
>>> 3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse
>>> doesn't work any more. Fixes that issue.
>>>
>>> Reason is that VMMouse has priority and disables all other mouse
>>> entities and therefore must be disabled on reset.
>>
>> Any further comments before integrating the patch?
> 
> I implicitly asked you for a more verbose commit message.
> 
> For example, based on the info you provided as a reply above:
> 
> --8<--
> hw/vmmouse.c: Disable vmmouse on reboot
> 
> When a guest activated the vmmouse, following a reboot the vmmouse
> stayed enabled and the PS/2 mouse was unusable. That way, when rebooting
> to guests without vmmouse support the mouse would not work.
> 
> Fix this by disabling the vmmouse in its reset handler.
> --8<--

I have been unable to reproduce this issue with our qemu-kvm 0.15.1.
SLES 11 uses vmmouse, whereas SLES installation does not use vmmouse.
After doing a kdump or reboot in SLES, the mouse worked just fine in
either of them.

The patch doesn't break anything for me though.

Andreas
Jan Kiszka Jan. 24, 2012, 12:14 p.m. UTC | #6
On 2012-01-12 19:37, Andreas Färber wrote:
> Am 08.01.2012 17:31, schrieb Andreas Färber:
>> Am 08.01.2012 13:01, schrieb Gerhard Wiesinger:
>>> On Wed, 4 Jan 2012, Gerhard Wiesinger wrote:
>>>
>>>> Testscenario:
>>>> 1.) Boot e.g. OS with VMMouse support (e.g. Windows)
>>>> 2.) reboot
>>>> 3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse
>>>> doesn't work any more. Fixes that issue.
>>>>
>>>> Reason is that VMMouse has priority and disables all other mouse
>>>> entities and therefore must be disabled on reset.
>>>
>>> Any further comments before integrating the patch?
>>
>> I implicitly asked you for a more verbose commit message.
>>
>> For example, based on the info you provided as a reply above:
>>
>> --8<--
>> hw/vmmouse.c: Disable vmmouse on reboot
>>
>> When a guest activated the vmmouse, following a reboot the vmmouse
>> stayed enabled and the PS/2 mouse was unusable. That way, when rebooting
>> to guests without vmmouse support the mouse would not work.
>>
>> Fix this by disabling the vmmouse in its reset handler.
>> --8<--
> 
> I have been unable to reproduce this issue with our qemu-kvm 0.15.1.
> SLES 11 uses vmmouse, whereas SLES installation does not use vmmouse.
> After doing a kdump or reboot in SLES, the mouse worked just fine in
> either of them.

I can confirm the that this patch fixes a real issue. Setup: qemu.git,
opensuse 11.4 guest, SDL graphic, system_reset while guest is using the
vmmouse. Without the patch, the vmmouse become unusable after the
reboot. Also, the mouse stays in absolute mode even before X starts again.

So please merge.

Jan
Gerhard Wiesinger Jan. 25, 2012, 8:08 p.m. UTC | #7
On Tue, 24 Jan 2012, Jan Kiszka wrote:
> I can confirm the that this patch fixes a real issue. Setup: qemu.git,
> opensuse 11.4 guest, SDL graphic, system_reset while guest is using the
> vmmouse. Without the patch, the vmmouse become unusable after the
> reboot. Also, the mouse stays in absolute mode even before X starts again.
>
> So please merge.

My bug reports are always real issues :-)

I submitted patch again with more detailed commit information, please 
merge into master and 1.0 bugfix. No code change.

Thnx.

Ciao,
Gerhard

--
http://www.wiesinger.com/
diff mbox

Patch

diff --git a/hw/vmmouse.c b/hw/vmmouse.c
index 1113f33..f9f5b53 100644
--- a/hw/vmmouse.c
+++ b/hw/vmmouse.c
@@ -254,6 +254,8 @@  static void vmmouse_reset(DeviceState *d)

      s->status = 0xffff;
      s->queue_size = VMMOUSE_QUEUE_SIZE;
+
+    vmmouse_disable(s);
  }

  static int vmmouse_initfn(ISADevice *dev)