1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

settings tab for changing devices/interface/source/bridge added

TODO: handle multiple interfaces
This commit is contained in:
Jan Krcmar 2016-01-14 16:59:50 +01:00
parent 1499af1eef
commit 50ddda98f2
4 changed files with 59 additions and 2 deletions

View file

@ -679,3 +679,16 @@ class wvmInstance(wvmConnect):
storage.clone_volume(vol_name, target_file)
self._defineXML(ElementTree.tostring(tree))
def change_network(self, network_data):
xml = self._XMLDesc(VIR_DOMAIN_XML_SECURE)
tree = ElementTree.fromstring(xml)
for interface in tree.findall('devices/interface'):
if interface.get('type') == 'bridge':
source = interface.find('source')
source.set('bridge', network_data['net-source-0'])
new_xml = ElementTree.tostring(tree)
self._defineXML(new_xml)