diff mbox

[PULL,02/13] console: add same displaychangelistener registration pre-condition

Message ID 20170424121708.31953-3-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gerd Hoffmann April 24, 2017, 12:16 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Catch an invalid state. Mainly useful for documentation purposes.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20170406120513.638-3-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/console.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/ui/console.c b/ui/console.c
index 0cbe5033dd..189eecfd29 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1410,6 +1410,8 @@  void register_displaychangelistener(DisplayChangeListener *dcl)
     static DisplaySurface *dummy;
     QemuConsole *con;
 
+    assert(!dcl->ds);
+
     if (dcl->ops->dpy_gl_ctx_create) {
         /* display has opengl support */
         assert(dcl->con);