Change in vdsm[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-19 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..


Patch Set 2:

* Update tracker: IGNORE, no Bug-Url found

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-19 Thread mmirecki
Marcin Mirecki has abandoned this change.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki 
Gerrit-Reviewer: gerrit-hooks 
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-15 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..


Patch Set 2:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-4.0'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki 
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[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-12 Thread mmirecki
Marcin Mirecki has posted comments on this change.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..


Patch Set 1: Code-Review-1 Verified-1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki 
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[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-12 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..


Patch Set 1:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-4.0'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
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[master]: draft: Hook nic_libvirt_migration_destination, proposal 2

2016-09-12 Thread mmirecki
Marcin Mirecki has uploaded a new change for review.

Change subject: draft: Hook nic_libvirt_migration_destination, proposal 2
..

draft: Hook nic_libvirt_migration_destination, proposal 2

A quick proposal for fixing broken custom nic migration.
Just a quick draft - do not review.

Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Signed-off-by: mirecki 
---
M lib/vdsm/hooks.py
M vdsm/virt/vm_migrate_hook.py
2 files changed, 21 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/63686/1

diff --git a/lib/vdsm/hooks.py b/lib/vdsm/hooks.py
index 03363ae..5f025ba 100644
--- a/lib/vdsm/hooks.py
+++ b/lib/vdsm/hooks.py
@@ -418,6 +418,12 @@
 raiseError=False, hookType=_JSON_HOOK)
 
 
+def nic_libvirt_migration_destination(
+devicexml, vmconf={}, customProperties={}):
+return _runHooksDir(devicexml, 'before_nic_libvirt_migration_destination',
+vmconf=vmconf, params=customProperties)
+
+
 def _getScriptInfo(path):
 try:
 with open(path) as f:
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..85b1b02 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -24,6 +24,7 @@
 import traceback
 import xml.etree.cElementTree as ET
 
+from vdsm import hooks
 from vdsm import jsonrpcvdscli
 from vdsm.config import config
 from vdsm.network import api as net_api
@@ -82,21 +83,28 @@
 
 
 def _set_bridge_interfaces(devices, target_vm_conf):
-target_vm_nets_by_vnic_mac = {dev['macAddr']: dev['network']
-  for dev in target_vm_conf['devices']
-  if dev.get('type') == 'interface'}
+
+target_vm_conf_by_mac = {dev['macAddr']: dev['network']
+ for dev in target_vm_conf['devices']
+ if dev.get('type') == 'interface'}
+
 for interface in devices.findall('interface'):
 if interface.get('type') == 'bridge':
-_bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac)
+_bind_iface_to_bridge(interface, target_vm_conf_by_mac)
 
 
-def _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac):
+def _bind_iface_to_bridge(interface, target_vm_conf_by_mac):
 elem_macaddr = interface.find('mac')
 mac_addr = elem_macaddr.get('address')
 
-target_vm_net = target_vm_nets_by_vnic_mac[mac_addr]
+target_conf = target_vm_conf_by_mac[mac_addr]
+target_vm_net = ['network']
+is_target_custom = target_conf.get('custom')
 target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
-if target_ovs_bridge:
+if is_target_custom:
+interface = hooks.nic_libvirt_migration_destination(interface,
+target_conf)
+elif target_ovs_bridge:
 _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net)
 else:
 _bind_iface_to_linux_bridge(interface, target_vm_net)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60e4cc7f801033cc830aa1a0aad32afecafe4fea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org