From patchwork Wed Apr 18 11:00:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 153473 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 1019AB6F9A for ; Wed, 18 Apr 2012 21:00:35 +1000 (EST) Received: from localhost ([::1]:42500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKScj-0007PJ-2H for incoming@patchwork.ozlabs.org; Wed, 18 Apr 2012 07:00:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKScY-0007P7-9H for qemu-devel@nongnu.org; Wed, 18 Apr 2012 07:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKScN-0007C2-EV for qemu-devel@nongnu.org; Wed, 18 Apr 2012 07:00:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKScN-0007Bl-6b for qemu-devel@nongnu.org; Wed, 18 Apr 2012 07:00:11 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3IB09dS000871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Apr 2012 07:00:09 -0400 Received: from garlic.redhat.com (vpn-8-89.rdu.redhat.com [10.11.8.89]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3IB070v032082; Wed, 18 Apr 2012 07:00:08 -0400 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Wed, 18 Apr 2012 14:00:06 +0300 Message-Id: <1334746806-28733-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qxl: don't assert on guest create_guest_primary 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 initiate the implicit destroy ourselves. Signed-off-by: Alon Levy --- hw/qxl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/qxl.c b/hw/qxl.c index 6776a7f..1ab3348 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1163,7 +1163,15 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm, QXLDevSurfaceCreate surface; QXLSurfaceCreate *sc = &qxl->guest_primary.surface; - assert(qxl->mode != QXL_MODE_NATIVE); + if (qxl->mode == QXL_MODE_NATIVE) { + /* + * allow a create without a destroy. This could be used + * later for an atomic "change primary" but right now just + * destroy the primary for the guest. Note that this uses + * the ability to have multiple concurrent async commands. + */ + qxl_destroy_primary(qxl, async); + } qxl_exit_vga_mode(qxl); surface.format = le32_to_cpu(sc->format);