From 2082d699ff120a077869d8220b0c13929ae20edf Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 5 Sep 2012 10:31:41 +0200 Subject: [PATCH] kvm tools: move mmio_debug into struct kvm_config This config option was 'extern'ed between different objects. Clean it up and move it into struct kvm_config. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- 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 4a6ff1a1eb7f..117a9def6766 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 f45edb0ca067..e3edf291ac0f 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 dd28ef339e7f..38ce117cdb25 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); } -- 2.39.5