Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 6: * #1364081::Update tracker: OK * Set MODIFIED::bug 1364081#1364081IGNORE, not all related patches are closed, check 61688 -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Dan Kenigsberg has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 5: Code-Review+2 passed tier1+2 by meni -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Dan Kenigsberg has submitted this change and it was merged. Change subject: ovs: acquire ifaces .. ovs: acquire ifaces Switch returns list of used devices, on upper level we should check if they are owned by us and if not, aquire them. Bug-Url: https://bugzilla.redhat.com/1364081 Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Signed-off-by: Petr HoráčekReviewed-on: https://gerrit.ovirt.org/60404 Reviewed-by: Edward Haas Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg Reviewed-on: https://gerrit.ovirt.org/61956 --- M lib/vdsm/network/netswitch.py M lib/vdsm/network/ovs/switch.py M tests/network/func_dhclient_test.py M tests/network/func_static_ip_test.py M tests/network/netfunctestlib.py M tests/network/nettestlib.py A tests/network/ovs_switch_test.py 7 files changed, 273 insertions(+), 18 deletions(-) Approvals: Jenkins CI: Passed CI tests Petr Horáček: Verified Dan Kenigsberg: Looks good to me, approved Edward Haas: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 5: * #1364081::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1364081::OK, public bug * Check Product::#1364081::OK, Correct classification oVirt * Check TM::#1364081::OK, correct target milestone ovirt-4.0.4 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Edward Haas has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Petr Horáček has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 4: Verified+1 network/*_test.py passed OK. -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 4: * #1364081::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1364081::OK, public bug * Check Product::#1364081::OK, Correct classification oVirt * Check TM::#1364081::OK, correct target milestone ovirt-4.0.4 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Edward Haas has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Petr Horáček has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 3: Verified+1 Passed network/*_test.py and functional/networkTests.py. -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 3: * #1364081::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1364081::OK, public bug * Check Product::#1364081::OK, Correct classification oVirt * Check TM::#1364081::ERROR, wrong target milestone for stable branch, --- should match ^.*4.0.* * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 2: * #1364081::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1364081::OK, public bug * Check Product::#1364081::OK, Correct classification oVirt * Check TM::#1364081::ERROR, wrong target milestone for stable branch, --- should match ^.*4.0.* * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
gerrit-hooks has posted comments on this change. Change subject: ovs: acquire ifaces .. Patch Set 1: * #1364081::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1364081::OK, public bug * Check Product::#1364081::OK, Correct classification oVirt * Check TM::#1364081::ERROR, wrong target milestone for stable branch, --- should match ^.*4.0.* * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/61956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-4.0 Gerrit-Owner: Petr HoráčekGerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[ovirt-4.0]: ovs: acquire ifaces
Hello Dan Kenigsberg, Edward Haas, I'd like you to do a code review. Please visit https://gerrit.ovirt.org/61956 to review the following change. Change subject: ovs: acquire ifaces .. ovs: acquire ifaces Switch returns list of used devices, on upper level we should check if they are owned by us and if not, aquire them. Bug-Url: https://bugzilla.redhat.com/1364081 Change-Id: I7a08095e03a3167d0be4f7261b9a43c9cf92c67b Signed-off-by: Petr HoráčekReviewed-on: https://gerrit.ovirt.org/60404 Reviewed-by: Edward Haas Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg --- M lib/vdsm/network/netswitch.py M lib/vdsm/network/ovs/switch.py M tests/network/func_dhclient_test.py M tests/network/func_static_ip_test.py M tests/network/netfunctestlib.py M tests/network/nettestlib.py A tests/network/ovs_switch_test.py 7 files changed, 273 insertions(+), 18 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/61956/1 diff --git a/lib/vdsm/network/netswitch.py b/lib/vdsm/network/netswitch.py index 9dbd4fd..6df8ed8 100644 --- a/lib/vdsm/network/netswitch.py +++ b/lib/vdsm/network/netswitch.py @@ -32,6 +32,7 @@ from vdsm.utils import memoized from . import connectivity +from . import ifacquire from . import legacy_switch from . import errors as ne from .ovs import info as ovs_info @@ -155,18 +156,20 @@ nets2remove.update(nets2edit) with Transaction(in_rollback=in_rollback) as config: -with ovs_switch.create_setup(_ovs_info) as s: -s.remove_nets(nets2remove) -s.remove_bonds(bonds2remove) -s.edit_bonds(bonds2edit) -s.add_bonds(bonds2add) -s.add_nets(nets2add) -_update_running_config(networks, bondings, config) -ovs_switch.cleanup() -_setup_ipv6autoconf(networks) -_set_ovs_links_up(nets2add, bonds2add, bonds2edit) -_setup_ovs_ip_config(nets2add, nets2remove) -connectivity.check(options) +with ifacquire.Transaction(ovs_netinfo['networks']) as acq: +with ovs_switch.create_setup(_ovs_info) as s: +s.remove_nets(nets2remove) +s.remove_bonds(bonds2remove) +s.edit_bonds(bonds2edit) +s.add_bonds(bonds2add) +s.add_nets(nets2add) +acq.acquire(s.acquired_ifaces) +_update_running_config(networks, bondings, config) +ovs_switch.cleanup() +_setup_ipv6autoconf(networks) +_set_ovs_links_up(nets2add, bonds2add, bonds2edit) +_setup_ovs_ip_config(nets2add, nets2remove) +connectivity.check(options) def _update_running_config(networks, bondings, running_config): diff --git a/lib/vdsm/network/ovs/switch.py b/lib/vdsm/network/ovs/switch.py index 85fcb36..356dcc2 100644 --- a/lib/vdsm/network/ovs/switch.py +++ b/lib/vdsm/network/ovs/switch.py @@ -66,6 +66,17 @@ self._bridges_by_sb = ovs_info.bridges_by_sb self._northbounds_by_sb = ovs_info.northbounds_by_sb +self._acquired_ifaces = set() + +@property +def acquired_ifaces(self): +""" +Report the interfaces that have been added to networks/bondings, either +by add or edit actions, including ifaces that have been removed and +re-added to a different network/bonding. +""" +return self._acquired_ifaces + def __enter__(self): return self @@ -87,6 +98,7 @@ bridge = self._bridges_by_sb[bond] to_be_configured_slaves = attrs['nics'] +self._acquired_ifaces.update(to_be_configured_slaves) running_bond = self._ovs_info.bridges[bridge]['ports'][bond] running_slaves = running_bond['bond']['slaves'] @@ -109,7 +121,9 @@ for bond, attrs in six.iteritems(bonds): bridge = self._create_bridge() self._bridges_by_sb[bond] = bridge -self._create_sb_bond(bridge, bond, attrs['nics']) +to_be_configured_slaves = attrs['nics'] +self._create_sb_bond(bridge, bond, to_be_configured_slaves) +self._acquired_ifaces.update(to_be_configured_slaves) self._transaction.add(*self._edit_mode( bond, attrs.get('options', ''))) @@ -121,6 +135,7 @@ attach = list(itertools.chain.from_iterable( self._ovsdb.attach_bond_slave(bond, slave) for slave in to_be_configured - running)) + detach = list(itertools.chain.from_iterable( self._ovsdb.detach_bond_slave(bond, slave) for slave in running - to_be_configured)) @@ -195,6 +210,8 @@ def add_nets(self, nets): for net, attrs in six.iteritems(nets): nic = attrs.get('nic') +if nic: +self._acquired_ifaces.add(nic)