[Kimchi-devel] [PATCH V3 3/4] vmiface update support: update mockmodel
shaohef at linux.vnet.ibm.com
shaohef at linux.vnet.ibm.com
Tue Apr 29 16:37:56 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 bce28d1..5166609 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -740,6 +740,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