kvm: kvmctl: use a table to dispatch IO requests in kvmctl (v2)
commitc5b0f86c66f1051a0e566e7e75f020ab67f322b2
authorAnthony Liguori <aliguori@us.ibm.com>
Wed, 10 Oct 2007 20:03:47 +0000 (10 15:03 -0500)
committerAvi Kivity <avi@qumranet.com>
Thu, 11 Oct 2007 11:24:57 +0000 (11 13:24 +0200)
treecf2340a156318bbbf731c3d284d0967bd85266e8
parent73ae2609cc4ccbc8329de1df2fdc7b3bd37bc5c6
kvm: kvmctl: use a table to dispatch IO requests in kvmctl (v2)

This patch attempts to clean up kvmctl so that it can be more easily made to
work for multiple architectures and to support more emulation.

For dispatch, it's using a simple array as suggested by Avi.

For x86, we'll have two tables, a pio_table and an mmio_table.  For PPC we can
just have a single table.  The IO functions can support accesses of up to 8
bytes and can handle input/output in the same function.

I tried to keep this nice and simple so as to not add too much complexity to
kvmctl.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
kvm/user/main.c