From patchwork Tue Feb 21 21:39:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 142368 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9262AB6F62 for ; Wed, 22 Feb 2012 08:40:19 +1100 (EST) Received: from localhost ([::1]:56679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxRU-0008Df-Uo for incoming@patchwork.ozlabs.org; Tue, 21 Feb 2012 16:40:12 -0500 Received: from eggs.gnu.org ([140.186.70.92]:59715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxRA-00080t-6V for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzxR5-0005fq-AV for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzxR5-0005fZ-1u for qemu-devel@nongnu.org; Tue, 21 Feb 2012 16:39:47 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1LLdjCa005549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 Feb 2012 16:39:46 -0500 Received: from garlic.redhat.com (vpn-200-36.tlv.redhat.com [10.35.200.36]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1LLdc63001985; Tue, 21 Feb 2012 16:39:43 -0500 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com, spice-devel@freedesktop.org, yhalperi@redhat.com, elmarco@redhat.com Date: Tue, 21 Feb 2012 23:39:29 +0200 Message-Id: <1329860377-6284-2-git-send-email-alevy@redhat.com> In-Reply-To: <1329860377-6284-1-git-send-email-alevy@redhat.com> References: <1329860377-6284-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v4 1/9] console: don't call console_select unnecessarily 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: Gerd Hoffman Tested-by: Alon Levy --- console.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/console.c b/console.c index 135394f..cfcc2f7 100644 --- a/console.c +++ b/console.c @@ -181,12 +181,14 @@ void vga_hw_screen_dump(const char *filename) /* There is currently no way of specifying which screen we want to dump, so always dump the first one. */ - console_select(0); + if (previous_active_console && previous_active_console->index != 0) { + console_select(0); + } if (consoles[0] && consoles[0]->hw_screen_dump) { consoles[0]->hw_screen_dump(consoles[0]->hw, filename); } - if (previous_active_console) { + if (previous_active_console && previous_active_console->index != 0) { console_select(previous_active_console->index); } }