Change in vdsm[ovirt-3.6]: vm: destroy: try harder destroying a Vm

fromani at redhat.com fromani at redhat.com
Thu Mar 31 10:54:10 UTC 2016


Hello Dan Kenigsberg,

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

    https://gerrit.ovirt.org/55536

to review the following change.

Change subject: vm: destroy: try harder destroying a Vm
......................................................................

vm: destroy: try harder destroying a Vm

The current Vm code to destroy a Vm starts
nice, using graceful destroy, and hits harder
if the nice way fails.

However, the failure of the first graceful attempt
is only detected when libvirt returns a specific error code.
Indeed, the return code of libvirt changed between RHEL6 and RHEL7.
This looks fragile and looks like unnecessary detail.

Digging into history, I was not able to find the reason why we look
for a specific error code.

This patch just drops the specific error code check.
Now Vdsm always uses the harsh way if the nice way fails.

Change-Id: Ic6519bf45565ffb879781926f437811a9bf5302b
Bug-Url: https://bugzilla.redhat.com/1309884
Backport-To: 3.6
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/53747
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/55536/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 30d2f07..81c166d 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3862,7 +3862,8 @@
                 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:
+                if e.get_error_code() in (libvirt.VIR_ERR_OPERATION_FAILED,
+                                          libvirt.VIR_ERR_SYSTEM_ERROR,):
                     safe_to_force = True
                 return response.error('destroyErr'), safe_to_force
         return response.success(), safe_to_force


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6519bf45565ffb879781926f437811a9bf5302b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list