Reviewed-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
On 28-07-2015 19:33, dhbarboza82(a)gmail.com wrote:
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
The 'getVMCPIDevices' API was missing these infos that are
present in other API calls such as getAllAvailableDevices.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
src/kimchi/model/vmhostdevs.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/model/vmhostdevs.py b/src/kimchi/model/vmhostdevs.py
index 9a7d03b..a9f6d77 100644
--- a/src/kimchi/model/vmhostdevs.py
+++ b/src/kimchi/model/vmhostdevs.py
@@ -217,10 +217,15 @@ class VMHostDevModel(object):
raise NotFoundError('KCHVMHDEV0001E',
{'vmid': vmid, 'dev_name': dev_name})
+ dev_model = DeviceModel(conn=self.conn)
for e in hostdev:
deduced_name = DeviceModel.deduce_dev_name(e, self.conn)
if deduced_name == dev_name:
- return {'name': dev_name, 'type':
e.attrib['type']}
+ dev_info = dev_model.lookup(dev_name)
+ return {'name': dev_name,
+ 'type': e.attrib['type'],
+ 'product': dev_info.get('product', None),
+ 'vendor': dev_info.get('vendor', None)}
raise NotFoundError('KCHVMHDEV0001E',
{'vmid': vmid, 'dev_name': dev_name})
--
Jose Ricardo Ziviani
-----------------------------
Software Engineer
Linux Technology Center - IBM