From patchwork Sun Apr 10 10:26:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 90502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A0027B6F1C for ; Sun, 10 Apr 2011 20:27:46 +1000 (EST) Received: from localhost ([127.0.0.1]:45532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8rrp-00061O-1h for incoming@patchwork.ozlabs.org; Sun, 10 Apr 2011 06:27:41 -0400 Received: from [140.186.70.92] (port=39570 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8rqQ-00060U-Qw for qemu-devel@nongnu.org; Sun, 10 Apr 2011 06:26:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8rqP-0007Sz-Ev for qemu-devel@nongnu.org; Sun, 10 Apr 2011 06:26:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8rqP-0007Sb-2b for qemu-devel@nongnu.org; Sun, 10 Apr 2011 06:26:13 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3AAQADR014609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 10 Apr 2011 06:26:10 -0400 Received: from playa.tlv.redhat.com (dhcp-3-110.tlv.redhat.com [10.35.3.110]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3AAQ76P013116 for ; Sun, 10 Apr 2011 06:26:09 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Sun, 10 Apr 2011 13:26:03 +0300 Message-Id: <1302431166-17771-2-git-send-email-alevy@redhat.com> In-Reply-To: <1302431166-17771-1-git-send-email-alevy@redhat.com> References: <1302431166-17771-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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 1/4] qxl: interface_get_command: fix reported mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org report correct mode when in undefined mode. --- hw/qxl.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index fe4212b..63e295b 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -336,6 +336,21 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info) info->n_surfaces = NUM_SURFACES; } +static const char *qxl_mode_to_string(int mode) +{ + switch (mode) { + case QXL_MODE_COMPAT: + return "compat"; + case QXL_MODE_NATIVE: + return "native"; + case QXL_MODE_UNDEFINED: + return "undefined"; + case QXL_MODE_VGA: + return "vga"; + } + return "unknown"; +} + /* called from spice server thread context only */ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext) { @@ -358,8 +373,7 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext) case QXL_MODE_COMPAT: case QXL_MODE_NATIVE: case QXL_MODE_UNDEFINED: - dprint(qxl, 2, "%s: %s\n", __FUNCTION__, - qxl->cmdflags ? "compat" : "native"); + dprint(qxl, 2, "%s: %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode)); ring = &qxl->ram->cmd_ring; if (SPICE_RING_IS_EMPTY(ring)) { return false;