From: Sasha Levin Date: Wed, 5 Sep 2012 08:31:40 +0000 (+0200) Subject: kvm tools: move ioport_debug into struct kvm_config X-Git-Tag: next-20120910~8^2~23 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=39a7dc1cd3c1374e6e07a093b5a2241c92676f82;p=karo-tx-linux.git kvm tools: move ioport_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 --- diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 8221c22d1f92..4a6ff1a1eb7f 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 3ffc2c2c0edc..f45edb0ca067 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 662a78b84edb..2208c15e97b3 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)