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 <kra...@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