From patchwork Fri Aug 27 09:59:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 62838 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 289F9B70D9 for ; Fri, 27 Aug 2010 20:08:07 +1000 (EST) Received: from localhost ([127.0.0.1]:43437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oovqu-0001kT-6L for incoming@patchwork.ozlabs.org; Fri, 27 Aug 2010 06:08:04 -0400 Received: from [140.186.70.92] (port=37212 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OovjJ-00079l-8s for qemu-devel@nongnu.org; Fri, 27 Aug 2010 06:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OovjC-0008T7-Nb for qemu-devel@nongnu.org; Fri, 27 Aug 2010 06:00:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57759) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OovjC-0008T0-DR for qemu-devel@nongnu.org; Fri, 27 Aug 2010 06:00:06 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7RA051m024462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 Aug 2010 06:00:05 -0400 Received: from rincewind.home.kraxel.org (vpn1-5-145.ams2.redhat.com [10.36.5.145]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7RA005u024664; Fri, 27 Aug 2010 06:00:01 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id A311140343; Fri, 27 Aug 2010 11:59:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 27 Aug 2010 11:59:50 +0200 Message-Id: <1282903199-30669-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1282903199-30669-1-git-send-email-kraxel@redhat.com> References: <1282903199-30669-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v4 01/10] Use display types for local display only. 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 This patch drops DT_VNC. The display types are only used to select select the local display (i.e. curses, sdl, coca, ...). Remote displays (for now only vnc, spice will follow) can be enabled independently. Signed-off-by: Gerd Hoffmann --- sysemu.h | 1 - vl.c | 24 +++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sysemu.h b/sysemu.h index a1f6466..b81a70e 100644 --- a/sysemu.h +++ b/sysemu.h @@ -94,7 +94,6 @@ typedef enum DisplayType DT_DEFAULT, DT_CURSES, DT_SDL, - DT_VNC, DT_NOGRAPHIC, } DisplayType; diff --git a/vl.c b/vl.c index 91d1684..d90b275 100644 --- a/vl.c +++ b/vl.c @@ -172,6 +172,7 @@ static const char *data_dir; const char *bios_name = NULL; enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; DisplayType display_type = DT_DEFAULT; +int display_remote = 0; const char* keyboard_layout = NULL; ram_addr_t ram_size; const char *mem_path = NULL; @@ -2468,7 +2469,7 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_vnc: - display_type = DT_VNC; + display_remote++; vnc_display = optarg; break; case QEMU_OPTION_no_acpi: @@ -2898,17 +2899,17 @@ int main(int argc, char **argv, char **envp) /* just use the first displaystate for the moment */ ds = get_displaystate(); - if (display_type == DT_DEFAULT) { + if (display_type == DT_DEFAULT && !display_remote) { #if defined(CONFIG_SDL) || defined(CONFIG_COCOA) display_type = DT_SDL; #else - display_type = DT_VNC; vnc_display = "localhost:0,to=99"; show_vnc_port = 1; #endif } + /* init local displays */ switch (display_type) { case DT_NOGRAPHIC: break; @@ -2926,7 +2927,12 @@ int main(int argc, char **argv, char **envp) cocoa_display_init(ds, full_screen); break; #endif - case DT_VNC: + default: + break; + } + + /* init remote displays */ + if (vnc_display) { vnc_display_init(ds); if (vnc_display_open(ds, vnc_display) < 0) exit(1); @@ -2934,12 +2940,10 @@ int main(int argc, char **argv, char **envp) if (show_vnc_port) { printf("VNC server running on `%s'\n", vnc_display_local_addr(ds)); } - break; - default: - break; } - dpy_resize(ds); + /* display setup */ + dpy_resize(ds); dcl = ds->listeners; while (dcl != NULL) { if (dcl->dpy_refresh != NULL) { @@ -2949,12 +2953,10 @@ int main(int argc, char **argv, char **envp) } dcl = dcl->next; } - - if (display_type == DT_NOGRAPHIC || display_type == DT_VNC) { + if (ds->gui_timer == NULL) { nographic_timer = qemu_new_timer(rt_clock, nographic_update, NULL); qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock)); } - text_consoles_set_display(ds); if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) {