[Kimchi-devel] [PATCH V5 3/5] Update mockmodel for spice support
apporc
appleorchard2000 at gmail.com
Fri Jan 10 12:44:21 UTC 2014
Update mockmodel for spice support.
Code about graphics port are removed.
Signed-off-by: apporc <appleorchard2000 at 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):
--
1.7.9.5
More information about the Kimchi-devel
mailing list