@@ -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"), \
@@ -48,6 +48,7 @@ struct kvm_config {
bool custom_rootfs;
bool no_net;
bool no_dhcp;
+ bool ioport_debug;
};
#endif
@@ -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)
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> --- 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(-)