From patchwork Sun Oct 21 08:46:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 1622321 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8DCF1DFFF1 for ; Sun, 21 Oct 2012 08:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022Ab2JUIqJ (ORCPT ); Sun, 21 Oct 2012 04:46:09 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:34005 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757Ab2JUIqH (ORCPT ); Sun, 21 Oct 2012 04:46:07 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so1343817pbb.19 for ; Sun, 21 Oct 2012 01:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=8MxQ+WJPHObaViTpMZhEmWw48Td0Ss6Hh6v00/DqvKQ=; b=0qLE2Ksdmut9+na2vJ2Eg3lc6N0xXRC1WQhJT6woGRDeogsiRSIv3pF9eqDCGG282B /Gll3GUv3wvzCKCoQP1Niaiwbn2T2C81Eh6x3Cwt4fumhjbcAfe7f1mcnEXIwSxtBJjo mV2BE0+7bZcggiLqpFHJ7ZCh2/fVpVkVAZ7ydhlWLJZF0jI2BF2uxjKyv/5d+GIpb0GC iUlThp+kU1IHU3sl/33/fTi5mKTJNvsqHb/4q/3kjKNx7oAcXpyRXs0jHh3yJHN0Vhsw ZKhJSYBoCZJC7F5bBQxOTraOJLDWtO9wPn/BSvo1t0DGJ4ueVzlTH5QT6H9CMnY0jqZa nntg== Received: by 10.68.129.5 with SMTP id ns5mr20408607pbb.103.1350809166893; Sun, 21 Oct 2012 01:46:06 -0700 (PDT) Received: from hj.localdomain ([219.236.95.9]) by mx.google.com with ESMTPS id ox5sm4041495pbc.75.2012.10.21.01.46.02 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 21 Oct 2012 01:46:05 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Sasha Levin , Ingo Molnar , Cyrill Gorcunov , kvm@vger.kernel.org Subject: [PATCH] kvm tools: Fix SDL and VNC by adding default vidmode Date: Sun, 21 Oct 2012 16:46:58 +0800 Message-Id: <1350809218-7887-1-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.11.7 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org In commit d73b168b3145f7bfe3f0e5d968653a1125b93a4e (kvm tools: ui improvements), the code to set a default vidmode was killed accidentally. This makes SDL and VNC not working unless '--vidmode' option is added, e.g lkvm run --sdl --vidmode 786. Signed-off-by: Asias He --- tools/kvm/builtin-run.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 50495a3..709ed33 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -593,9 +593,17 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv) if (!kvm->cfg.script) kvm->cfg.script = DEFAULT_SCRIPT; - if (!kvm->cfg.vnc && !kvm->cfg.sdl) + if (!kvm->cfg.vidmode) kvm->cfg.vidmode = -1; + /* vidmode should be either specified or set by default */ + if (kvm->cfg.vnc || kvm->cfg.sdl) { + if (kvm->cfg.vidmode == -1) + kvm->cfg.vidmode = 0x312; + } else { + kvm->cfg.vidmode = 0; + } + if (!kvm->cfg.network) kvm->cfg.network = DEFAULT_NETWORK;