]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: move ioport_debug into struct kvm_config
authorSasha Levin <levinsasha928@gmail.com>
Wed, 5 Sep 2012 08:31:40 +0000 (10:31 +0200)
committerPekka Enberg <penberg@kernel.org>
Wed, 5 Sep 2012 13:22:35 +0000 (16:22 +0300)
This config option was 'extern'ed between different objects. Clean it up
and move it into struct kvm_config.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/builtin-run.c
tools/kvm/include/kvm/kvm-config.h
tools/kvm/ioport.c

index 8221c22d1f920dcbda883be0b1553fff6ba7519d..4a6ff1a1eb7f857b69ddf341cb804cce256faba7 100644 (file)
@@ -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"),                       \
index 3ffc2c2c0edcce40f4b4111a771708c088376ad3..f45edb0ca067a15ad2a0ec4f536f17f48ee573b0 100644 (file)
@@ -48,6 +48,7 @@ struct kvm_config {
        bool custom_rootfs;
        bool no_net;
        bool no_dhcp;
+       bool ioport_debug;
 };
 
 #endif
index 662a78b84edbf13f1e305d60fece7b2c96cbf459..2208c15e97b3eca7ce506c5b862a5c39925e8ba0 100644 (file)
@@ -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)