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})
--
2.4.3