Change in vdsm[master]: virt: clean and modernize the destroy() path

fromani at redhat.com fromani at redhat.com
Tue Feb 23 17:12:34 UTC 2016


Francesco Romani has uploaded a new change for review.

Change subject: virt: clean and modernize the destroy() path
......................................................................

virt: clean and modernize the destroy() path

cleanup the destroy path with no changes in behaviour.

Change-Id: I46296fe7ac6c13e064014298148f518ea6b1e1d8
Bug-Url: https://bugzilla.redhat.com/1309884
Backport-To: 3.6
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/53931/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index a73da42..9493110 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3866,21 +3866,23 @@
                 self.log.info("VM '%s' already down and destroyed",
                               self.conf['vmId'])
             else:
-                self.log.warning("Failed to destroy VM '%s' gracefully",
-                                 self.conf['vmId'], exc_info=True)
+                self.log.warning(
+                    "Failed to destroy VM '%s' gracefully (error=%i)",
+                    self.id, e.get_error_code())
                 if e.get_error_code() == libvirt.VIR_ERR_OPERATION_FAILED:
                     return self._destroyVmForceful()
                 return response.error('destroyErr')
-        return {'status': doneCode}
+        return response.success()
 
     def _destroyVmForceful(self):
         try:
             self._dom.destroy()
-        except libvirt.libvirtError:
-            self.log.warning("Failed to destroy VM '%s'",
-                             self.conf['vmId'], exc_info=True)
+        except libvirt.libvirtError as e:
+            self.log.warning(
+                "Failed to destroy VM '%s' forcefully (error=%i)",
+                self.id, e.get_error_code())
             return response.error('destroyErr')
-        return {'status': doneCode}
+        return response.success()
 
     def _deleteVm(self):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46296fe7ac6c13e064014298148f518ea6b1e1d8
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