From patchwork Wed Sep 5 08:31:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1406491 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 0BCB4DF264 for ; Wed, 5 Sep 2012 08:32:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758070Ab2IEIc3 (ORCPT ); Wed, 5 Sep 2012 04:32:29 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:55460 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754651Ab2IEIcH (ORCPT ); Wed, 5 Sep 2012 04:32:07 -0400 Received: by wgbfm10 with SMTP id fm10so3892176wgb.1 for ; Wed, 05 Sep 2012 01:32:06 -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=8SGHFs6S8yPNy6X0SZ/rOMyCOrzQSrTN14JHz8MEq1E=; b=EjWwR0ATJQQ7bZ4qXYIsoX+qLqaAsy0Y6JpbXiSqY7g85J98aDBOf4AajRi7GKsY+m crEIUbV02zjjhX+qgqcti1KvdnnVQm2vsYaPwVNOLClNocMqiYqnJ+urrcyfWmfD9mUO 5VmPG3BdsZO8PMQMWMW7UmSlS3LVbn1cyGEn1i58L/Yy2fyEKwpAE6rvZ5bHw1b2oAUH XQGisLAUNzxsJVsj04illbeuf8T8ARsSt/wdIFhQVq7TCB3rYUykonnWKJFuEUq1Ns+H yR6sa8UdEKdaM/3lWQqDmBboUaQrddDT9eOTZmXMd4txtQgK3rLEq0F2OvIK/96e+mb3 eEIw== Received: by 10.180.94.38 with SMTP id cz6mr36402594wib.10.1346833926292; Wed, 05 Sep 2012 01:32:06 -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.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:32:05 -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 07/33] kvm tools: move mmio_debug into struct kvm_config Date: Wed, 5 Sep 2012 10:31:41 +0200 Message-Id: <1346833927-15740-8-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/mmio.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 4a6ff1a..117a9de 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 mmio_debug; static int kvm_run_wrapper; extern int active_console; extern int debug_iodelay; @@ -472,7 +471,7 @@ static int shmem_parser(const struct option *opt, const char *arg, int unset) "Enable single stepping"), \ OPT_BOOLEAN('\0', "debug-ioport", &(cfg)->ioport_debug, \ "Enable ioport debugging"), \ - OPT_BOOLEAN('\0', "debug-mmio", &mmio_debug, \ + OPT_BOOLEAN('\0', "debug-mmio", &(cfg)->mmio_debug, \ "Enable MMIO debugging"), \ OPT_INTEGER('\0', "debug-iodelay", &debug_iodelay, \ "Delay IO by millisecond"), \ diff --git a/tools/kvm/include/kvm/kvm-config.h b/tools/kvm/include/kvm/kvm-config.h index f45edb0..e3edf29 100644 --- a/tools/kvm/include/kvm/kvm-config.h +++ b/tools/kvm/include/kvm/kvm-config.h @@ -49,6 +49,7 @@ struct kvm_config { bool no_net; bool no_dhcp; bool ioport_debug; + bool mmio_debug; }; #endif diff --git a/tools/kvm/mmio.c b/tools/kvm/mmio.c index dd28ef33..38ce117 100644 --- a/tools/kvm/mmio.c +++ b/tools/kvm/mmio.c @@ -21,7 +21,6 @@ struct mmio_mapping { }; static struct rb_root mmio_tree = RB_ROOT; -bool mmio_debug = false; static struct mmio_mapping *mmio_search(struct rb_root *root, u64 addr, u64 len) { @@ -130,7 +129,7 @@ bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_ if (mmio) mmio->mmio_fn(phys_addr, data, len, is_write, mmio->ptr); else { - if (mmio_debug) + if (kvm->cfg.mmio_debug) fprintf(stderr, "Warning: Ignoring MMIO %s at %016llx (length %u)\n", to_direction(is_write), phys_addr, len); }