Hello Vinzenz Feenstra, Dan Kenigsberg, Michal Skrivanek, Martin Polednik,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/36065

to review the following change.

Change subject: vm: ensure graphics configuration data in recovery
......................................................................

vm: ensure graphics configuration data in recovery

Graphics Devices may be not sent by Engine. To cover that VDSM
reconstructs them from other VM configuration data - which is safe to do
since the information is there, just organized in a different way.

The recovery path skips that step, so the configuration is inconsistent.
Later in the creation path the configuration is assumed to be present
(either fixed by VDSM or given by Engine), but it is not, and this makes
the domain initialization fail in the last stages.

This is evident when upgrading Hosted Engine.
This issue was unnoticed so far because the reccomended upgrade path
is to migrate VMs away from the host being upgraded, and that avoid and
triggers the existing safety nets for the missing configuration data.

Change-Id: I6ed99b3e1a62d1e4c5bff5722bce9a966b193c73
Bug-Url: https://bugzilla.redhat.com/1168709
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/36021
Reviewed-by: Michal Skrivanek <[email protected]>
Reviewed-by: Vinzenz Feenstra <[email protected]>
Reviewed-by: Martin Polednik <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/36065/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 82cb0f1..4309b73 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3271,6 +3271,11 @@
                 if drive['device'] == 'disk' and isVdsmImage(drive):
                     self.sdIds.append(drive['domainID'])
 
+            # we need to fix the graphics device configuration in the
+            # case VDSM is upgraded from 3.4 to 3.5 on the host without
+            # rebooting it. Evident on, but not limited to, the HE case.
+            self._fixLegacyConf()
+
         for devType, devClass in self.DeviceMapping:
             for dev in devices[devType]:
                 self._devices[devType].append(devClass(self.conf, self.log,
@@ -6007,6 +6012,11 @@
         if 'tlsPort' in dev:
             self.conf['displaySecurePort'] = dev['tlsPort']
 
+    def _fixLegacyConf(self):
+        with self._confLock:
+            if not self._getFirstGraphicsDevice():
+                self.conf['devices'].extend(self.getConfGraphics())
+
     def _getFirstGraphicsDevice(self):
         for dev in self.conf.get('devices', ()):
             if dev.get('type') == GRAPHICS_DEVICES:


-- 
To view, visit http://gerrit.ovirt.org/36065
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ed99b3e1a62d1e4c5bff5722bce9a966b193c73
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Martin Polednik <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to