Edward Haas has uploaded a new change for review.

Change subject: net: Ignore missing graphics from VM conf on target host
......................................................................

net: Ignore missing graphics from VM conf on target host

The new VM migration libvirt hook handling, recreate the interface and
graphics devices of the domxml to fir the target host. It does so using
the VM conf data.

Unfortunate, there was a bug in Engine that did not pushed the graphics
configuration to VDSM, leaving VM conf without the display information.
VDSM on the other hand, used a default, listen to all, when this data
has not been received from Engine.

On migration, the domxml includes the graphics section while the target
VM conf does not, causing an exception that fails the action.

This patch silently ignores such scenarios, leaving the source domxml as
is in the graphics section.

Change-Id: I8cc730c6448b1f70500c86b3ab39af21fa23bd5a
Signed-off-by: Edward Haas <edwa...@redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/64300/1

diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..0ae3995 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -37,6 +37,10 @@
     pass
 
 
+class VmMigrationMissingDisplayConf(Exception):
+    pass
+
+
 def main(domain, event, phase, stdin=sys.stdin, stdout=sys.stdout, *args):
     if event not in ('migrate', 'restore'):
         sys.exit(0)
@@ -77,7 +81,14 @@
     if 'devices' not in target_vm_conf:
         raise VmMigrationHookError('No devices entity in VM conf')
 
-    _set_graphics(devices, target_vm_conf)
+    try:
+        _set_graphics(devices, target_vm_conf)
+    except VmMigrationMissingDisplayConf:
+        # Due to a bug in Engine, there can be a scenario where the domxml
+        # includes a graphics section, however, the VM config on target does
+        # not. In such cases, ignore and do not touch this section.
+        pass
+
     _set_bridge_interfaces(devices, target_vm_conf)
 
 
@@ -174,7 +185,7 @@
         if params and 'displayNetwork' in params and 'displayIp' in params:
             return params['displayNetwork'], params['displayIp']
 
-    raise VmMigrationHookError('VM conf graphics not detected')
+    raise VmMigrationMissingDisplayConf('VM conf graphics not detected')
 
 
 def _vm_item(vdscli, vm_uuid):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cc730c6448b1f70500c86b3ab39af21fa23bd5a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwa...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to