[Kimchi-devel] [PATCH] vmHostDevModel: returning 'product' and 'vendor' in lookup
Daniel Henrique Barboza
dhbarboza82 at gmail.com
Wed Jul 29 13:47:11 UTC 2015
Patch applied to master branch of https://github.com/danielhb/kimchi
Thanks for the review!
On 07/28/2015 07:37 PM, Jose Ricardo Ziviani wrote:
> Reviewed-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
>
> On 28-07-2015 19:33, dhbarboza82 at gmail.com wrote:
>> From: Daniel Henrique Barboza <dhbarboza82 at 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 at 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})
>>
>
More information about the Kimchi-devel
mailing list