Reviewed-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
On 01/10/2014 08:44 PM, apporc wrote:
Update mockmodel for spice support.
Code about graphics port are removed.
Signed-off-by: apporc <appleorchard2000(a)gmail.com>
---
src/kimchi/mockmodel.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 9ecef77..7210482 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -143,8 +143,13 @@ class MockModel(object):
t = self._get_template(t_name, vm_overrides)
t.validate()
- vm = MockVM(vm_uuid, name, t.info)
- icon = t.info.get('icon')
+ t_info = copy.deepcopy(t.info)
+ graphics = params.get('graphics')
+ if graphics:
+ t_info.update({'graphics': graphics})
+
+ vm = MockVM(vm_uuid, name, t_info)
+ icon = t_info.get('icon')
if icon:
vm.info['icon'] = icon
@@ -626,7 +631,9 @@ class MockVM(object):
'memory': template_info['memory'],
'cpus': template_info['cpus'],
'icon': None,
- 'graphics': {'type': 'vnc', 'port':
None}}
+ 'graphics': {'type': 'vnc',
'listen': '0.0.0.0', 'port': None}
+ }
+ self.info['graphics'].update(template_info['graphics'])
class MockStoragePool(object):
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center