summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-10-03 20:13:58 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-10-08 12:15:17 +0200
commite25a0651f4be22099122b5e14c77c354be0aa88b (patch)
tree5050076e4c00a68822d7b87c9f142c837ed5fc17 /hw
parentffe01e599f106bedf13ba0e0f6956735b1942a0c (diff)
downloadhqemu-e25a0651f4be22099122b5e14c77c354be0aa88b.zip
hqemu-e25a0651f4be22099122b5e14c77c354be0aa88b.tar.gz
hw/qxl: exit on failure to register qxl interface
This prevents a segfault later on when the device reset handler tries to access a NULL ssd.worker since interface_attach_worker has not been called. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/qxl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index eb7707c..e99ed55 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -2037,7 +2037,11 @@ static int qxl_init_common(PCIQXLDevice *qxl)
qxl->ssd.qxl.base.sif = &qxl_interface.base;
qxl->ssd.qxl.id = qxl->id;
- qemu_spice_add_interface(&qxl->ssd.qxl.base);
+ if (qemu_spice_add_interface(&qxl->ssd.qxl.base) != 0) {
+ error_report("qxl interface %d.%d not supported by spice-server\n",
+ SPICE_INTERFACE_QXL_MAJOR, SPICE_INTERFACE_QXL_MINOR);
+ return -1;
+ }
qemu_add_vm_change_state_handler(qxl_vm_change_state_handler, qxl);
init_pipe_signaling(qxl);
OpenPOWER on IntegriCloud