mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
spice: fix initialization order
Register displaychangelistener last, after spice is fully initialized,
otherwise we may hit NULL pointer dereferences when qemu starts calling
our callbacks.
Commit e250d949fe
triggers this bug.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
365b1e9e34
commit
bdd4df332a
2 changed files with 9 additions and 3 deletions
10
hw/qxl.c
10
hw/qxl.c
|
@ -2049,6 +2049,7 @@ static int qxl_init_primary(PCIDevice *dev)
|
|||
PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
|
||||
VGACommonState *vga = &qxl->vga;
|
||||
PortioList *qxl_vga_port_list = g_new(PortioList, 1);
|
||||
int rc;
|
||||
|
||||
qxl->id = 0;
|
||||
qxl_init_ramsize(qxl);
|
||||
|
@ -2063,9 +2064,14 @@ static int qxl_init_primary(PCIDevice *dev)
|
|||
qemu_spice_display_init_common(&qxl->ssd, vga->ds);
|
||||
|
||||
qxl0 = qxl;
|
||||
register_displaychangelistener(vga->ds, &display_listener);
|
||||
|
||||
return qxl_init_common(qxl);
|
||||
rc = qxl_init_common(qxl);
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
register_displaychangelistener(vga->ds, &display_listener);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int qxl_init_secondary(PCIDevice *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue