qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/qxl: exit on failure to register qxl interface
@ 2012-10-03 18:13 Alon Levy
  0 siblings, 0 replies; only message in thread
From: Alon Levy @ 2012-10-03 18:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel

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>
---
 hw/qxl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 58c4643..4effb66 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -2044,7 +2044,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);
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-03 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 18:13 [Qemu-devel] [PATCH] hw/qxl: exit on failure to register qxl interface Alon Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).