Skip to contentSkip to conversation

kvm tools: Use ioport__register() for legacy devices

PATCH In review Pekka Enberg 2 participants 2 messages Apr 10, 2011 KVM

lore
Share & tools
lore
#0 lore raw

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]>
---
 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
index b77f565..0218329 100644
@@ -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
index d978ee5..1944307 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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]>

Looks good for me.

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
index b77f565..0218329 100644