From patchwork Wed Sep 5 08:31:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1406451 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 8570BDF264 for ; Wed, 5 Sep 2012 08:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757894Ab2IEIcP (ORCPT ); Wed, 5 Sep 2012 04:32:15 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:45317 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929Ab2IEIcF (ORCPT ); Wed, 5 Sep 2012 04:32:05 -0400 Received: by mail-we0-f174.google.com with SMTP id x8so220516wey.19 for ; Wed, 05 Sep 2012 01:32:04 -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:in-reply-to:references; bh=E+1DieDj8MEvmkmC7IN7SpakN9rmG25iEH9qFu1xqHA=; b=NenIP0mJ67Rekoy/JOazbOJwK8+EqwEQLUAfK2HOGK8/qiDTbC+05koUoh1cA9jyPv aFlucyXHgb2Yl8pGB69RTG+OtnsVWhhVuAvYu6Ywm+mxq5D71DeQVRNJYvATwdSKoPgK IPYKtJxszZsElZZPvOcZykOPsZY0lVceR0CwHM6CqTA0hJhxlwdhzAR9y7DzjearRZfJ 97ibr5imkqMJcW4X8xWub1lspEPxnP5wH6T7FKBlVPncaCL3t8/+P3ldEFoC+GAUyGHu kMrWJqL6hfZSfJb1GHMKoFlHzP9zobkX7uzzhNz04lDTM63b4l3MkaaIqce8BebAZh9Q qZzg== Received: by 10.216.240.3 with SMTP id d3mr13677588wer.87.1346833924307; Wed, 05 Sep 2012 01:32:04 -0700 (PDT) Received: from lappy.capriciverd.com (20.Red-80-59-140.staticIP.rima-tde.net. [80.59.140.20]) by mx.google.com with ESMTPS id q4sm27971068wix.9.2012.09.05.01.32.01 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:32:03 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH 06/33] kvm tools: move ioport_debug into struct kvm_config Date: Wed, 5 Sep 2012 10:31:40 +0200 Message-Id: <1346833927-15740-7-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346833927-15740-1-git-send-email-levinsasha928@gmail.com> References: <1346833927-15740-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This config option was 'extern'ed between different objects. Clean it up and move it into struct kvm_config. Signed-off-by: Sasha Levin --- tools/kvm/builtin-run.c | 3 +-- tools/kvm/include/kvm/kvm-config.h | 1 + tools/kvm/ioport.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 8221c22..4a6ff1a 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -57,7 +57,6 @@ struct kvm *kvm; struct kvm_cpu **kvm_cpus; __thread struct kvm_cpu *current_kvm_cpu; -extern bool ioport_debug; extern bool mmio_debug; static int kvm_run_wrapper; extern int active_console; @@ -471,7 +470,7 @@ static int shmem_parser(const struct option *opt, const char *arg, int unset) "Enable debug messages"), \ OPT_BOOLEAN('\0', "debug-single-step", &(cfg)->single_step, \ "Enable single stepping"), \ - OPT_BOOLEAN('\0', "debug-ioport", &ioport_debug, \ + OPT_BOOLEAN('\0', "debug-ioport", &(cfg)->ioport_debug, \ "Enable ioport debugging"), \ OPT_BOOLEAN('\0', "debug-mmio", &mmio_debug, \ "Enable MMIO debugging"), \ diff --git a/tools/kvm/include/kvm/kvm-config.h b/tools/kvm/include/kvm/kvm-config.h index 3ffc2c2..f45edb0 100644 --- a/tools/kvm/include/kvm/kvm-config.h +++ b/tools/kvm/include/kvm/kvm-config.h @@ -48,6 +48,7 @@ struct kvm_config { bool custom_rootfs; bool no_net; bool no_dhcp; + bool ioport_debug; }; #endif diff --git a/tools/kvm/ioport.c b/tools/kvm/ioport.c index 662a78b..2208c15 100644 --- a/tools/kvm/ioport.c +++ b/tools/kvm/ioport.c @@ -21,7 +21,6 @@ DEFINE_MUTEX(ioport_mutex); static u16 free_io_port_idx; /* protected by ioport_mutex */ static struct rb_root ioport_tree = RB_ROOT; -bool ioport_debug; static u16 ioport__find_free_port(void) { @@ -177,10 +176,10 @@ bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int s error: br_read_unlock(); - if (ioport_debug) + if (kvm->cfg.ioport_debug) ioport_error(port, data, direction, size, count); - return !ioport_debug; + return !kvm->cfg.ioport_debug; } int ioport__init(struct kvm *kvm)