Apply failed.

On 7/21/2014 5:36 PM, Zhou Zheng Sheng wrote:

This patch series is to enable Kimchi to assign hos devices directly to
a VM, thus greately improve VM performance. Currently we support assigning
PCI device, USB device and SCSI LUN. For example, we can assign an NIC
to VM to improve guest network throughput, or passthrough a USB camera
to enable the guest OS to record video.

Host devices form a tree. We can assign most of the devices in the tree
to VM. By assigning a device, all the devices in its sub-tree are also
assigned. It might not make sense to assign a USB controller, because
the host may be using one of the devices connected to the controller.
Instead, Kimchi just presents the "leaf" devices to assign to guest.

In recent Linux kernel and KVM, it is able to recognize the IOMMU group
of a PCI device. The "leaf" PCI devices in the same IOMMU group should
be assigned and dismissed together. The IOMMU group is the actual
smallest isolation granularity of the PCI devices.

The first patch is to list all host devices information. It's useful on
its own to show host devices information.

The second patch is to list all eligible host devices to assign, as well
as the "affected" devices in the same IOMMU group.

The third patch creates a sub-collection "hostdevs" to the VM resource,
and deals with assigning and dismissing devices.

The fourth patch adds a sub-collection "vm_holders" to the host device
resource. It's to list all VMs that are holding the device.

I'll update API and unit test once everyone is happy with the interface
and logic.

  Change the URI for listing affected passthrough devices, suggested by
  Aline. Move to src/kimchi/ Still discussing API
  with the front-end developer. Once the API accepted, The author should
  add tests for model and mockmodel, and change and API.json
  Some minor coding style improvements.
  Do not passthrough PCI device of class code 0x07. It might contains
system device not suitable to assign to guest.
  Filter ealigible pci devices according to pci class. When assigning a
device to VM, check if there are other VMs holding it. Use
"kimchi.model.utils.get_vm_config_flag()" to correctly set the device
attaching API flag.
  Add new sub-collection to host device to list the VMs holding the device.
  Fix a small naming error introduced by rebase.
  Handle the devices in VM's sub-collection "hostdevs".
  Handle the devices in VM template.

Zhou Zheng Sheng (4):
  Host device passthrough: List all types of host devices
  Host device passthrough: List eligible device to passthrough
  Host device passthrough: Directly assign and dissmis host device from
  Host device passthrough: List VMs that are holding a host device

 docs/                            |  11 +-
 src/kimchi/control/             |   7 +
 src/kimchi/control/vm/      |  44 +++++
 src/kimchi/             |  10 +-
 src/kimchi/                     |  10 +
 src/kimchi/                |   7 +-
 src/kimchi/model/             |   2 +
 src/kimchi/model/               |  38 ++--
 src/kimchi/model/            | 311 +++++++++++++++++++++++++++++++
 src/kimchi/model/ |  18 +-
 src/kimchi/model/         | 324 +++++++++++++++++++++++++++++++++
 src/kimchi/          |   3 +
 src/kimchi/                 |  26 ++-
 tests/                     |   6 +-
 tests/              |   7 +-
 15 files changed, 784 insertions(+), 40 deletions(-)
 create mode 100644 src/kimchi/control/vm/
 create mode 100644 src/kimchi/model/
 create mode 100644 src/kimchi/model/