spice: init dcl before registering qxl interface

Without this spice might callback into qemu before ssd->dcl.con is
initialized, resulting in a segfault due to NULL pointer dereference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Gerd Hoffmann 2016-02-19 09:23:03 +01:00
parent 8eb779e422
commit b5e751b51f

View File

@ -775,14 +775,14 @@ static void qemu_spice_display_init_one(QemuConsole *con)
qemu_spice_display_init_common(ssd);
ssd->dcl.ops = &display_listener_ops;
ssd->dcl.con = con;
ssd->qxl.base.sif = &dpy_interface.base;
qemu_spice_add_display_interface(&ssd->qxl, con);
assert(ssd->worker);
qemu_spice_create_host_memslot(ssd);
ssd->dcl.ops = &display_listener_ops;
ssd->dcl.con = con;
register_displaychangelistener(&ssd->dcl);
}