All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Owen smith <owen.smith@citrix.com>
Cc: stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org,
	xen-devel@lists.xen.org
Subject: Re: [Qemu-devel] [PATCH 1/3] xenfb: Unregister keyboard event handler correctly
Date: Thu, 11 Sep 2014 01:33:24 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1409110130410.8137@kaball.uk.xensource.com> (raw)
In-Reply-To: <1410356546-22264-2-git-send-email-owen.smith@citrix.com>

On Wed, 10 Sep 2014, Owen smith wrote:
> Keyboard event handler was replaced with a new handler on disconnect.
> Use the unregister function to remove keyboard handler.
> 
> Signed-off-by: Owen smith <owen.smith@citrix.com>
> ---
>  hw/display/xenfb.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
> index 07ddc9d..2c39753 100644
> --- a/hw/display/xenfb.c
> +++ b/hw/display/xenfb.c
> @@ -62,6 +62,7 @@ struct XenInput {
>      int abs_pointer_wanted; /* Whether guest supports absolute pointer */
>      int button_state;       /* Last seen pointer button state */
>      int extended;
> +    QEMUPutKbdEntry *qkbd;
>      QEMUPutMouseEntry *qmouse;
>  };
>  
> @@ -364,7 +365,6 @@ static int input_initialise(struct XenDevice *xendev)
>      if (rc != 0)
>  	return rc;
>  
> -    qemu_add_kbd_event_handler(xenfb_key_event, in);
>      return 0;
>  }
>  
> @@ -383,17 +383,26 @@ static void input_connected(struct XenDevice *xendev)
>      in->qmouse = qemu_add_mouse_event_handler(xenfb_mouse_event, in,
>  					      in->abs_pointer_wanted,
>  					      "Xen PVFB Mouse");
> +    qemu_activate_mouse_event_handler(in->qmouse);

This change is not described in the commit message.
Why is this necessary? Is it related to the keyboard change?


> +    if (in->qkbd) {
> +        qemu_remove_kbd_event_handler(in->qkbd);
> +    }
> +    in->qkbd = qemu_add_kbd_event_handler(xenfb_key_event, in);
>  }
>  
>  static void input_disconnect(struct XenDevice *xendev)
>  {
>      struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
>  
> +    if (in->qkbd) {
> +        qemu_remove_kbd_event_handler(in->qkbd);
> +        in->qkbd = NULL;
> +    }
>      if (in->qmouse) {
>  	qemu_remove_mouse_event_handler(in->qmouse);
>  	in->qmouse = NULL;
>      }
> -    qemu_add_kbd_event_handler(NULL, NULL);
>      common_unbind(&in->c);
>  }
>  
> -- 
> 2.1.0
> 

  parent reply	other threads:[~2014-09-11  0:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 13:42 [Qemu-devel] [PATCH 0/3] xenfb: Add support for Windows PV frontend Owen smith
2014-09-10 13:42 ` Owen smith
2014-09-10 13:42 ` [Qemu-devel] [PATCH 1/3] xenfb: Unregister keyboard event handler correctly Owen smith
2014-09-10 13:42   ` Owen smith
2014-09-11  0:33   ` Stefano Stabellini
2014-09-11  0:33   ` Stefano Stabellini [this message]
2014-09-11 11:32     ` Owen Smith
2014-09-11 11:32     ` [Qemu-devel] " Owen Smith
2014-09-10 13:42 ` [Qemu-devel] [PATCH 2/3] xenfb: Add option to use grant ref for shared page Owen smith
2014-09-10 13:42   ` Owen smith
2014-09-11  1:01   ` Stefano Stabellini
2014-09-11  1:01   ` [Qemu-devel] " Stefano Stabellini
2014-09-11 11:33     ` Owen Smith
2014-09-11 18:01       ` Stefano Stabellini
2014-09-11 18:01       ` [Qemu-devel] " Stefano Stabellini
2014-09-11 11:33     ` Owen Smith
2014-09-10 13:42 ` [Qemu-devel] [PATCH 3/3] xenfb: Add "feature-no-abs-rescale" for Windows PV frontend Owen smith
2014-09-10 13:42   ` Owen smith
2014-09-11  1:23   ` [Qemu-devel] " Stefano Stabellini
2014-09-11 11:34     ` Owen Smith
2014-09-11 11:34     ` [Qemu-devel] " Owen Smith
2014-09-11 18:04       ` Stefano Stabellini
2014-09-11 18:04       ` [Qemu-devel] " Stefano Stabellini
2014-09-29 12:20     ` [Qemu-devel] [Xen-devel] " Ian Campbell
2014-09-29 12:20       ` Ian Campbell
2014-09-11  1:23   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1409110130410.8137@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=owen.smith@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.