Change in vdsm[master]: net: Libvirt hook that enables ovs-legacy migration

edwardh at redhat.com edwardh at redhat.com
Mon Apr 4 11:42:53 UTC 2016


Edward Haas has posted comments on this change.

Change subject: net: Libvirt hook that enables ovs-legacy migration
......................................................................


Patch Set 9:

(7 comments)

https://gerrit.ovirt.org/#/c/55497/9/vdsm_hooks/ovs/Makefile.am
File vdsm_hooks/ovs/Makefile.am:

Line 28: dist_vdsmexec_SCRIPTS = \
Line 29: 	ovs_migrate.py \
Line 30: 	ovs_utils.py \
Line 31: 	$(NULL)
Line 32: 
> install-data handling is not needed here? (see the second part of this file
I do not understand your question... Aren't those the installation of the hook files in the relevant hook directories? These do not seem to be related to this hook.

This patch is about a libvirt hook (not a vdsm hook), that is distributed with the vdsm ovs hook.
Line 33: CLEANFILES = \
Line 34: 	$(nodist_noinst_DATA)
Line 35: 
Line 36: EXTRA_DIST = \


https://gerrit.ovirt.org/#/c/55497/9/vdsm_hooks/ovs/ovs_migrate.py
File vdsm_hooks/ovs/ovs_migrate.py:

Line 1: #!/usr/bin/env python
Line 2: # Copyright 2015 Red Hat, Inc.
> 2016
Done
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by
Line 6: # the Free Software Foundation; either version 2 of the License, or


Line 18: # Refer to the README and COPYING files for full details of the license
Line 19: #
Line 20: from __future__ import print_function
Line 21: 
Line 22: import six
> six is not a standard library package
Done
Line 23: import sys
Line 24: import xml.etree.ElementTree as ET
Line 25: 
Line 26: from vdsm import netconfpersistence


Line 27: 
Line 28: import ovs_utils
Line 29: 
Line 30: # LOG_FILE = '/tmp/libvirthook_ovs_migrate.log'
Line 31: # log = open(LOG_FILE, 'w')
> leftovers?
No, I wanted to keep an option for logging/debugging if we need to.
It's ugly, I agree.. Do you have any suggestion on how to make it nicer?
Line 32: 
Line 33: 
Line 34: def main(domain, event, phase, *args, **gwargs):
Line 35:     if event not in ('migrate', 'restore'):


PS9, Line 36: 0
> why not 1?
Because it's not an error, it's just something we do not want to handle, so libvirt should continue as usual.


Line 48:             # 'source bridge' element must exist
Line 49:             elem_source = interface.find('source')
Line 50:             source_bridge = elem_source.get('bridge')
Line 51: 
Line 52:             elem_virtualport = interface.find('virtualport')
> could be moved before to line 44
'find' is a method that looks for the element direct children, not in the entire tree.
We also need to look for it for each interface..
Line 53: 
Line 54:             # If the source bridge is the OVS switch name (its default bridge)
Line 55:             # it cannot be validated against the running config, as it is not a
Line 56:             # net name. Instead, a non vlan network is looked for and if found,


Line 54:             # If the source bridge is the OVS switch name (its default bridge)
Line 55:             # it cannot be validated against the running config, as it is not a
Line 56:             # net name. Instead, a non vlan network is looked for and if found,
Line 57:             # it is assumed to be the target network (raising the limitation of
Line 58:             # having a single non-vlan network on a host).
> this limitation is only for OVS networks. you can have another legacy non-v
This is a migration between an OVS host to a Legacy host.
If the target is Legacy and the source OVS, on the local host we have no OVS networks, only legacy ones.
Line 59:             if source_bridge == ovs_utils.BRIDGE_NAME:
Line 60:                 nets = [net for net, attrs in six.iteritems(
Line 61:                         running_config.networks) if attrs.get('vlan') is None]
Line 62:                 if len(nets) == 1:


-- 
To view, visit https://gerrit.ovirt.org/55497
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I29cf441cc365d3679382e44410dad0906d9be3ec
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list