kvm tools: Use ioport__register() for legacy devices
PATCH 1/1 kvm tools: Use ioport__register() for legacy devices
This patch cleans up the table-based setup for legacy devices to use ioport__register().
Cc Asias He <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Ingo Molnar <[email protected]>
Signed-off-by Pekka Enberg <[email protected]>
--- tools/kvm/include/kvm/ioport.h | 2 + tools/kvm/ioport.c | 128 ++++++++++++++++------------------------ tools/kvm/kvm-run.c | 3 + 3 files changed, 57 insertions(+), 76 deletions(-)
tools/kvm/include/kvm/ioport.h +2 -0
@@ -18,6 +18,8 @@ struct ioport_operations {bool (*io_out)(struct kvm *self,uint16_t port,void *data,int size,uint32_t count); }; +void ioport__setup_legacy (void ); +void ioport__register (uint16_t port,struct ioport_operations *ops,int count);static inline uint8_t ioport__read8 (uint8_t *data)
tools/kvm/ioport.c +52 -76
137 lines not on this page · raw message
tools/kvm/kvm-run.c +3 -0
@@ -18,6 +18,7 @@#include <kvm/util.h> #include <kvm/pci.h> #include <kvm/term.h> +#include <kvm/ioport.h> /* header files for gitish interface */ #include <kvm/kvm-run.h>
@@ -196,6 +197,8 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) real_cmdline)) die("unable to load kernel %s", kernel_filename); +ioport__setup_legacy (); +kvm__setup_bios (kvm);serial8250__init (kvm);
Signature · 1 line
1.7.0.4
Quoted 7 lines · Pekka Enberg
This patch cleans up the table-based setup for legacy devices to use
ioport__register().Cc Asias He <[email protected]>Cc Cyrill Gorcunov <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Pekka Enberg <[email protected]>
Looks good for me.
Reviewed-by Amos Kong <[email protected]>
Quoted 10 lines
--- tools/kvm/include/kvm/ioport.h | 2 + tools/kvm/ioport.c | 128 ++++++++++++++++------------------------ tools/kvm/kvm-run.c | 3 + 3 files changed, 57 insertions(+), 76 deletions(-)tools/kvm/include/kvm/ioport.h +0
-0