Change in vdsm[master]: vm: make acpiShutdown more robust

fromani at redhat.com fromani at redhat.com
Thu Nov 6 13:16:15 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: vm: make acpiShutdown more robust
......................................................................

vm: make acpiShutdown more robust

In the Vm shutdown flow, the actual 'destruction'
of the domain -in libvirt jargon- may already happen
asynchonously, e.g. if QEMU dies suddenly.
Moreover, we want to make it asynchronously even on
our own code for performance reasons.

This means that the Vm._dom attribute may become None
asyncrhonously, even inside the Vm powerdown flow
itself.

This patch address the case for the acpiShutdown,
fixing this issue:

Thread-259072::ERROR::2014-10-15 12:06:52,842::utils::1193::utils.Callback::(__call__) acpiCallback failed
  Traceback (most recent call last):
    File "/usr/lib64/python2.6/site-packages/vdsm/utils.py", line 1191, in __call__
      result = self.func(*self.args, **self.kwargs)
    File "/usr/share/vdsm/virt/vmpowerdown.py", line 91, in acpiCallback
      self.vm.acpiShutdown()
    File "/usr/share/vdsm/virt/vm.py", line 4942, in acpiShutdown
      self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN)

AttributeError: 'NoneType' object has no attribute 'shutdownFlags'

Change-Id: I244f00d62ee24fb42ba3d654961a8fc22f4a6c25
Related-To: https://bugzilla.redhat.com/show_bug.cgi?id=1154389
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/34879/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9740ab3..2384aca 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4402,7 +4402,13 @@
 
     def acpiShutdown(self):
         self._shutdownReason = vmexitreason.ADMIN_SHUTDOWN
-        self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN)
+        try:
+            self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN)
+        except AttributeError:
+            if not self._released:
+                raise
+            # else the VM was already shut off asynchronously,
+            # so ignore error and quickly exit
 
     def setBalloonTarget(self, target):
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I244f00d62ee24fb42ba3d654961a8fc22f4a6c25
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list