Tested-by: Socorro Stoppler <socorro(a)linux.vnet.ibm.com>
On 07/14/2015 08:00 AM, dhbarboza82(a)gmail.com wrote:
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
This patch set adds a new API to retrieve only the available devices
from the host. 'available' means only the devices that weren't
attached to any other VM.
The backend is generic and can work with all devices, but the API
provided here is made for 'PCI' devices only as we do not provide
official support for USB and SCSI passthrough yet.
Usage:
get all available devices:
$ curl -u danielhb -H "Content-Type: application/json" -H "Accept:
application/json" -X GET
"http://localhost:8010/host/devices?_passthrough=true&_available_only=true"
get all available PCI devices:
$ curl -u danielhb -H "Content-Type: application/json" -H "Accept:
application/json" -X GET
"http://localhost:8010/host/devices?_passthrough=true&_available_only=true&_cap=pci"
Daniel Henrique Barboza (3):
Get available host passthrough devices: model changes
Adding new API in the UI APIs and docs
Mockmodel and test changes for the new API
docs/API.md | 2 +
src/kimchi/API.json | 6 +++
src/kimchi/i18n.py | 1 +
src/kimchi/mockmodel.py | 3 +-
src/kimchi/model/host.py | 105 ++++++++++++++++++++++++++++++++++++++++-
src/kimchi/model/vmhostdevs.py | 75 ++---------------------------
tests/test_host.py | 11 +++++
ui/js/src/kimchi.api.js | 14 ++++++
8 files changed, 144 insertions(+), 73 deletions(-)