Francesco Romani has uploaded a new change for review.

Change subject: vm: ensure valid Vm._dom before domDependentInit
......................................................................

vm: ensure valid Vm._dom before domDependentInit

If we reach the _domDependentInit stage of a VM
creation, for every possible flow, including
recovery, we must guarantee that the _dom
attribute is not None, thus VDSM and libvirt
are connected.

Quite a lot of errors could be ignored on
recovery, but this cannot, ever.

This patch moves the '_dom is not None'
check inside _domDependentInit, and makes
it mandatory for each flow.

Change-Id: Ie2840b066260790d4f3079a9cd34f87a70e96891
Signed-off-by: Francesco Romani <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/30146/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 540d037..20f9a92 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3162,6 +3162,9 @@
                 pass
             raise Exception('destroy() called before Vm started')
 
+        if self._dom is None:
+            raise MissingLibvirtDomainError()
+
         self._getUnderlyingVmInfo()
         self._getUnderlyingVmDevicesInfo()
         self._updateAgentChannels()
@@ -3284,9 +3287,6 @@
                 hooks.after_device_create(dev._deviceXML, self.conf,
                                           dev.custom)
 
-        if not self._dom:
-            self.setDownStatus(ERROR, vmexitreason.LIBVIRT_START_FAILED)
-            return
         self._domDependentInit()
 
     def _updateDevices(self, devices):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2840b066260790d4f3079a9cd34f87a70e96891
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to