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

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Fri Apr 18 12:46:59 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 8c7d7bb..d788031 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -725,6 +725,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