From patchwork Mon Oct 8 10:49:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 189985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 80A382C00C1 for ; Mon, 8 Oct 2012 21:51:04 +1100 (EST) Received: from localhost ([::1]:42017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLAvO-0001kw-1p for incoming@patchwork.ozlabs.org; Mon, 08 Oct 2012 06:51:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLAuR-0008JS-8D for qemu-devel@nongnu.org; Mon, 08 Oct 2012 06:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLAuI-0006dA-HF for qemu-devel@nongnu.org; Mon, 08 Oct 2012 06:50:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLAuI-0006cw-8c for qemu-devel@nongnu.org; Mon, 08 Oct 2012 06:49:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q98Anrou032735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Oct 2012 06:49:53 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-30.ams2.redhat.com [10.36.116.30]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q98AnqoC003256; Mon, 8 Oct 2012 06:49:53 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 57D8643FC6; Mon, 8 Oct 2012 12:49:52 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 8 Oct 2012 12:49:47 +0200 Message-Id: <1349693391-32704-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1349693391-32704-1-git-send-email-kraxel@redhat.com> References: <1349693391-32704-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Alon Levy , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/8] hw/qxl: exit on failure to register qxl interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Alon Levy 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 Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 6 +++++- 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);