All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hid: vmstat fix
@ 2011-09-14  3:03 TeLeMan
  2011-09-14  7:15 ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: TeLeMan @ 2011-09-14  3:03 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

The commit "usb/hid: add hid_pointer_activate, use it" used
HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
mouse_grabbed should be added into vmstat.

Signed-off-by: TeLeMan <geleman@gmail.com>
---
 hw/hid.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/hid.c b/hw/hid.c
index c608400..72b861f 100644
--- a/hw/hid.c
+++ b/hw/hid.c
@@ -433,7 +433,7 @@ static const VMStateDescription vmstate_hid_ptr_queue = {

 const VMStateDescription vmstate_hid_ptr_device = {
     .name = "HIDPointerDevice",
-    .version_id = 1,
+    .version_id = 2,
     .minimum_version_id = 1,
     .post_load = hid_post_load,
     .fields = (VMStateField[]) {
@@ -443,6 +443,7 @@ const VMStateDescription vmstate_hid_ptr_device = {
         VMSTATE_UINT32(n, HIDState),
         VMSTATE_INT32(protocol, HIDState),
         VMSTATE_UINT8(idle, HIDState),
+        VMSTATE_INT32_V(ptr.mouse_grabbed, HIDState, 2),
         VMSTATE_END_OF_LIST(),
     }
 };
-- 
1.7.6.msysgit.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hid: vmstat fix
  2011-09-14  3:03 [Qemu-devel] [PATCH] hid: vmstat fix TeLeMan
@ 2011-09-14  7:15 ` Paolo Bonzini
  2011-09-14  7:40   ` TeLeMan
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-09-14  7:15 UTC (permalink / raw)
  To: qemu-devel

On 09/14/2011 05:03 AM, TeLeMan wrote:
> The commit "usb/hid: add hid_pointer_activate, use it" used
> HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
> mouse_grabbed should be added into vmstat.

Does this fix a bug?  qemu_activate_mouse_event_handler is meant to be 
called once per execution of the VM, it is not guest state.

Paolo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hid: vmstat fix
  2011-09-14  7:15 ` Paolo Bonzini
@ 2011-09-14  7:40   ` TeLeMan
  2011-09-14  7:59     ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: TeLeMan @ 2011-09-14  7:40 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Wed, Sep 14, 2011 at 15:15, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 09/14/2011 05:03 AM, TeLeMan wrote:
>>
>> The commit "usb/hid: add hid_pointer_activate, use it" used
>> HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
>> mouse_grabbed should be added into vmstat.
>
> Does this fix a bug?  qemu_activate_mouse_event_handler is meant to be
> called once per execution of the VM, it is not guest state.
Yes, this patch fixes the usb mouse not be working after loadvm in the
guest windows.

>
> Paolo
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hid: vmstat fix
  2011-09-14  7:40   ` TeLeMan
@ 2011-09-14  7:59     ` Paolo Bonzini
  2011-09-15 13:40       ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-09-14  7:59 UTC (permalink / raw)
  To: TeLeMan; +Cc: qemu-devel, Gerd Hoffmann

On 09/14/2011 09:40 AM, TeLeMan wrote:
>>> >>
>>> >>  The commit "usb/hid: add hid_pointer_activate, use it" used
>>> >>  HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
>>> >>  mouse_grabbed should be added into vmstat.
>> >
>> >  Does this fix a bug?  qemu_activate_mouse_event_handler is meant to be
>> >  called once per execution of the VM, it is not guest state.
> Yes, this patch fixes the usb mouse not be working after loadvm in the
> guest windows.

I'm wondering if, with your patch, Windows is actually using the PS/2 
mouse after loadvm...  If that is the case, perhaps instead you can move

         if (hs->kind == HID_MOUSE || hs->kind == HID_TABLET) {
             hid_pointer_activate(hs);
         }

from hw/usb-hid.c to hid_set_next_idle, which is called at post-load time.

Paolo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hid: vmstat fix
  2011-09-14  7:59     ` Paolo Bonzini
@ 2011-09-15 13:40       ` Gerd Hoffmann
  2011-09-19  3:56         ` TeLeMan
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2011-09-15 13:40 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: TeLeMan, qemu-devel

On 09/14/11 09:59, Paolo Bonzini wrote:
> On 09/14/2011 09:40 AM, TeLeMan wrote:
>>>> >>
>>>> >> The commit "usb/hid: add hid_pointer_activate, use it" used
>>>> >> HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
>>>> >> mouse_grabbed should be added into vmstat.
>>> >
>>> > Does this fix a bug? qemu_activate_mouse_event_handler is meant to be
>>> > called once per execution of the VM, it is not guest state.
>> Yes, this patch fixes the usb mouse not be working after loadvm in the
>> guest windows.
>
> I'm wondering if, with your patch, Windows is actually using the PS/2
> mouse after loadvm... If that is the case, perhaps instead you can move
>
> if (hs->kind == HID_MOUSE || hs->kind == HID_TABLET) {
> hid_pointer_activate(hs);
> }
>
> from hw/usb-hid.c to hid_set_next_idle, which is called at post-load time.

Makes sense to me.  Did you try whenever that fixes the winxp issue?

thanks,
   Gerd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hid: vmstat fix
  2011-09-15 13:40       ` Gerd Hoffmann
@ 2011-09-19  3:56         ` TeLeMan
  0 siblings, 0 replies; 6+ messages in thread
From: TeLeMan @ 2011-09-19  3:56 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Paolo Bonzini, qemu-devel

On Thu, Sep 15, 2011 at 21:40, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On 09/14/11 09:59, Paolo Bonzini wrote:
>>
>> On 09/14/2011 09:40 AM, TeLeMan wrote:
>>>>>
>>>>> >>
>>>>> >> The commit "usb/hid: add hid_pointer_activate, use it" used
>>>>> >> HIDMouseState.mouse_grabbed in hid_pointer_activate(), so
>>>>> >> mouse_grabbed should be added into vmstat.
>>>>
>>>> >
>>>> > Does this fix a bug? qemu_activate_mouse_event_handler is meant to be
>>>> > called once per execution of the VM, it is not guest state.
>>>
>>> Yes, this patch fixes the usb mouse not be working after loadvm in the
>>> guest windows.
>>
>> I'm wondering if, with your patch, Windows is actually using the PS/2
>> mouse after loadvm... If that is the case, perhaps instead you can move
>>
>> if (hs->kind == HID_MOUSE || hs->kind == HID_TABLET) {
>> hid_pointer_activate(hs);
>> }
>>
>> from hw/usb-hid.c to hid_set_next_idle, which is called at post-load time.
>
> Makes sense to me.  Did you try whenever that fixes the winxp issue?
I tested, it didn't fix this issue.
>
> thanks,
>  Gerd
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-19  3:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-14  3:03 [Qemu-devel] [PATCH] hid: vmstat fix TeLeMan
2011-09-14  7:15 ` Paolo Bonzini
2011-09-14  7:40   ` TeLeMan
2011-09-14  7:59     ` Paolo Bonzini
2011-09-15 13:40       ` Gerd Hoffmann
2011-09-19  3:56         ` TeLeMan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.