[Kimchi-devel] [PATCH V2 3/4] vmiface update support: update mockmodel

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Wed Apr 23 14:41:16 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

update mockmodel

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/mockmodel.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 866ad2c..e48b278 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -737,6 +737,18 @@ class MockModel(object):
         except KeyError:
             raise NotFoundError("KCHVMIF0001E", {'iface': mac, 'name': vm})
 
+    def vmiface_update(self, vm, mac, params):
+        dom = self._get_vm(vm)
+        try:
+            info = dom.ifaces[mac].info
+        except KeyError:
+            raise NotFoundError("KCHVMIF0001E", {'iface': mac, 'name': vm})
+        if info['type'] == 'network' and 'network' in params:
+            info['network'] = params['network']
+        if 'model' in params:
+            info['model'] = params['model']
+        return mac
+
     def tasks_get_list(self):
         with self.objstore as session:
             return session.get_list('task')
-- 
1.9.0




More information about the Kimchi-devel mailing list