OSDN Git Service

kvm: add device control API
authorScott Wood <scottwood@freescale.com>
Fri, 12 Apr 2013 14:08:42 +0000 (14:08 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 26 Apr 2013 18:27:20 +0000 (20:27 +0200)
commit852b6d57dc7fa378019786fa84727036e56839ea
tree4d617ba91f6fc5de3fddac349e695d914e626a49
parent7df35f549606e8a9004a77ef31dc80dfa893a590
kvm: add device control API

Currently, devices that are emulated inside KVM are configured in a
hardcoded manner based on an assumption that any given architecture
only has one way to do it.  If there's any need to access device state,
it is done through inflexible one-purpose-only IOCTLs (e.g.
KVM_GET/SET_LAPIC).  Defining new IOCTLs for every little thing is
cumbersome and depletes a limited numberspace.

This API provides a mechanism to instantiate a device of a certain
type, returning an ID that can be used to set/get attributes of the
device.  Attributes may include configuration parameters (e.g.
register base address), device state, operational commands, etc.  It
is similar to the ONE_REG API, except that it acts on devices rather
than vcpus.

Both device types and individual attributes can be tested without having
to create the device or get/set the attribute, without the need for
separately managing enumerated capabilities.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Documentation/virtual/kvm/api.txt
Documentation/virtual/kvm/devices/README [new file with mode: 0644]
include/linux/kvm_host.h
include/uapi/linux/kvm.h
virt/kvm/kvm_main.c