This patch series is mostly about cleanups: - Clean all the global variables we have to store configuration options. - Remove externed config options between objects. - Adding several exit routines to clean up on exit. - Remove the global 'kvm' object. - Contain arch specific init/exit calls within the corresponding non-arch specific code instead of the global init. This patch series also adds a method to call init/exit functions automatically after we've finished intializing config options. Doing so clears out a big chunk of repetetive code in our builtin-run init function, and makes adding new modules easier since there's now no need to link them to builtin-run. Sasha Levin (33): kvm tools: introduce kvm_config to store instance-specific config options kvm tools: generate command line options dynamically kvm tools: split struct kvm into arch specific part kvm tools: move kvm_config into struct kvm kvm tools: remove redundancy between kvm_config and kvm kvm tools: move ioport_debug into struct kvm_config kvm tools: move mmio_debug into struct kvm_config kvm tools: move active_console into struct kvm_config kvm tools: add private ptr to option parser kvm tools: disk image related cleanup kvm tools: move nrcpus into struct kvm_config kvm tools: move kvm_cpus into struct kvm kvm tools: improve framebuffer manager initialization kvm tools: improve term init/exit functions kvm tools: threadpool exit routine kvm tools: timer cleanup kvm tools: virtio-console init/exit kvm tools: virtio-rng init/exit kvm tools: virtio-bln init/exit kvm tools: pci-shmem init-exit kvm tools: virtio-net init/exit kvm tools: kvm-ipc cleanup kvm tools: kbd initialization check kvm tools: ui improvements kvm tools: kernel load/firmware cleanup kvm tools: ioport arch init kvm tools: ram init kvm tools: move the rest of the config initializations kvm tools: virtio-9p cleanup kvm tools: add init/exit automatic calls kvm tools: use init/exit where possible kvm tools: pass kvm ptr directly to timer injection kvm tools: remove global kvm object tools/kvm/Makefile | 3 +- tools/kvm/builtin-run.c | 1111 +++++------------------------- tools/kvm/disk/core.c | 73 +- tools/kvm/framebuffer.c | 9 +- tools/kvm/hw/i8042.c | 15 +- tools/kvm/hw/pci-shmem.c | 147 +++- tools/kvm/hw/rtc.c | 14 +- tools/kvm/hw/serial.c | 24 +- tools/kvm/hw/vesa.c | 6 +- tools/kvm/include/kvm/brlock.h | 16 +- tools/kvm/include/kvm/disk-image.h | 9 +- tools/kvm/include/kvm/framebuffer.h | 5 +- tools/kvm/include/kvm/i8042.h | 2 +- tools/kvm/include/kvm/ioport.h | 7 +- tools/kvm/include/kvm/kvm-config.h | 60 ++ tools/kvm/include/kvm/kvm-cpu.h | 6 +- tools/kvm/include/kvm/kvm-ipc.h | 8 +- tools/kvm/include/kvm/kvm.h | 38 +- tools/kvm/include/kvm/parse-options.h | 16 +- tools/kvm/include/kvm/pci-shmem.h | 6 +- tools/kvm/include/kvm/sdl.h | 8 +- tools/kvm/include/kvm/term.h | 16 +- tools/kvm/include/kvm/threadpool.h | 3 +- tools/kvm/include/kvm/util-init.h | 51 ++ tools/kvm/include/kvm/virtio-9p.h | 3 + tools/kvm/include/kvm/virtio-balloon.h | 3 +- tools/kvm/include/kvm/virtio-console.h | 3 +- tools/kvm/include/kvm/virtio-net.h | 6 +- tools/kvm/include/kvm/vnc.h | 10 +- tools/kvm/ioeventfd.c | 2 + tools/kvm/ioport.c | 23 +- tools/kvm/kvm-cpu.c | 81 ++- tools/kvm/kvm-ipc.c | 301 +++++++- tools/kvm/kvm.c | 229 ++---- tools/kvm/mmio.c | 13 +- tools/kvm/pci.c | 12 +- tools/kvm/powerpc/cpu_info.c | 2 +- tools/kvm/powerpc/include/kvm/kvm-arch.h | 24 +- tools/kvm/powerpc/irq.c | 2 +- tools/kvm/powerpc/kvm-cpu.c | 8 +- tools/kvm/powerpc/kvm.c | 42 +- tools/kvm/powerpc/spapr_hvcons.c | 14 +- tools/kvm/powerpc/spapr_pci.c | 2 +- tools/kvm/powerpc/xics.c | 24 +- tools/kvm/symbol.c | 4 +- tools/kvm/term.c | 61 +- tools/kvm/ui/sdl.c | 26 +- tools/kvm/ui/vnc.c | 26 +- tools/kvm/util/init.c | 69 ++ tools/kvm/util/threadpool.c | 36 +- tools/kvm/virtio/9p.c | 69 ++ tools/kvm/virtio/balloon.c | 23 +- tools/kvm/virtio/blk.c | 2 + tools/kvm/virtio/console.c | 26 +- tools/kvm/virtio/net.c | 142 +++- tools/kvm/virtio/pci.c | 6 +- tools/kvm/virtio/rng.c | 5 + tools/kvm/virtio/scsi.c | 2 + tools/kvm/x86/bios.c | 6 +- tools/kvm/x86/boot.c | 6 +- tools/kvm/x86/include/kvm/kvm-arch.h | 26 +- tools/kvm/x86/ioport.c | 20 +- tools/kvm/x86/irq.c | 2 + tools/kvm/x86/kvm-cpu.c | 32 +- tools/kvm/x86/kvm.c | 12 +- 65 files changed, 1632 insertions(+), 1426 deletions(-) create mode 100644 tools/kvm/include/kvm/kvm-config.h create mode 100644 tools/kvm/include/kvm/util-init.h create mode 100644 tools/kvm/util/init.c -- 1.7.12 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html