* [Qemu-devel] [PATCH] ui: fix dcl unregister
@ 2017-11-09 7:37 Gerd Hoffmann
2017-11-09 10:39 ` Marc-André Lureau
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2017-11-09 7:37 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
register checks for dcl->ds being NULL, to avoid registering
the same dcl twice.
Therefore dcl->ds must be cleared on unregister, otherwise
un-registering and re-registering doesn't work.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510809
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/console.c | 1 +
ui/vnc.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/ui/console.c b/ui/console.c
index eca854cbd5..c4c95abed7 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1471,6 +1471,7 @@ void unregister_displaychangelistener(DisplayChangeListener *dcl)
dcl->con->dcls--;
}
QLIST_REMOVE(dcl, next);
+ dcl->ds = NULL;
gui_setup_refresh(ds);
}
diff --git a/ui/vnc.c b/ui/vnc.c
index 9f8d5a1b1f..bd46f11fcc 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3044,6 +3044,7 @@ void vnc_display_init(const char *id)
{
VncDisplay *vd;
+ fprintf(stderr, "%s: %s\n", __func__, id);
if (vnc_display_find(id) != NULL) {
return;
}
@@ -3982,6 +3983,7 @@ void vnc_display_open(const char *id, Error **errp)
}
if (con != vd->dcl.con) {
+ fprintf(stderr, "%s: %s\n", __func__, id);
unregister_displaychangelistener(&vd->dcl);
vd->dcl.con = con;
register_displaychangelistener(&vd->dcl);
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] ui: fix dcl unregister
2017-11-09 7:37 [Qemu-devel] [PATCH] ui: fix dcl unregister Gerd Hoffmann
@ 2017-11-09 10:39 ` Marc-André Lureau
0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2017-11-09 10:39 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU
Hi
On Thu, Nov 9, 2017 at 8:37 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> register checks for dcl->ds being NULL, to avoid registering
> the same dcl twice.
>
> Therefore dcl->ds must be cleared on unregister, otherwise
> un-registering and re-registering doesn't work.
>
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510809
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> ui/console.c | 1 +
> ui/vnc.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/ui/console.c b/ui/console.c
> index eca854cbd5..c4c95abed7 100644
> --- a/ui/console.c
> +++ b/ui/console.c
> @@ -1471,6 +1471,7 @@ void unregister_displaychangelistener(DisplayChangeListener *dcl)
> dcl->con->dcls--;
> }
> QLIST_REMOVE(dcl, next);
> + dcl->ds = NULL;
> gui_setup_refresh(ds);
> }
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 9f8d5a1b1f..bd46f11fcc 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3044,6 +3044,7 @@ void vnc_display_init(const char *id)
> {
> VncDisplay *vd;
>
> + fprintf(stderr, "%s: %s\n", __func__, id);
> if (vnc_display_find(id) != NULL) {
> return;
> }
> @@ -3982,6 +3983,7 @@ void vnc_display_open(const char *id, Error **errp)
> }
>
> if (con != vd->dcl.con) {
> + fprintf(stderr, "%s: %s\n", __func__, id);
I suppose the 2 printf are not intentional.
> unregister_displaychangelistener(&vd->dcl);
> vd->dcl.con = con;
> register_displaychangelistener(&vd->dcl);
> --
> 2.9.3
>
>
without the printf,
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-09 10:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 7:37 [Qemu-devel] [PATCH] ui: fix dcl unregister Gerd Hoffmann
2017-11-09 10:39 ` Marc-André Lureau
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.