Dan Kenigsberg has uploaded a new change for review. Change subject: libvirtvm: prepare for <interface type='network'> ......................................................................
libvirtvm: prepare for <interface type='network'> In the near future (actually, in the following patch), I would like to define virtual interfaces with <source network>. If such a VM is migrated to a host expecting <source bridge>, bad thing would happen. This patch extracts <interface>'s network for bridge- and network-based interfaces alike. It should be applied to all the hosts in the cluster before generating the first network-based interface. Change-Id: Ib1eeb8c008d95c8812d855c7e073b5f78ffd67b2 Signed-off-by: Dan Kenigsberg <[email protected]> --- M vdsm/libvirtvm.py 1 file changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/9531/1 diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 3439dc3..1f15306 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -2790,10 +2790,15 @@ mac = x.getElementsByTagName('mac')[0].getAttribute('address') alias = x.getElementsByTagName('alias')[0].getAttribute('name') model = x.getElementsByTagName('model')[0].getAttribute('type') - bridge = None + + network = None source = x.getElementsByTagName('source') if source: - bridge = source[0].getAttribute('bridge') + network = source[0].getAttribute('bridge') + if not network: + network = source[0].getAttribute('network') + network = network[len(netinfo.LIBVIRT_NET_PREFIX):] + # Get nic address address = self._getUnderlyingDeviceAddress(x) for nic in self._devices[vm.NIC_DEVICES]: @@ -2819,8 +2824,8 @@ 'address': address, 'alias': alias, 'name': name} - if bridge: - nicDev['network'] = bridge + if network: + nicDev['network'] = network self.conf['devices'].append(nicDev) def _setWriteWatermarks(self): -- To view, visit http://gerrit.ovirt.org/9531 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1eeb8c008d95c8812d855c7e073b5f78ffd67b2 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
