Change in vdsm[master]: vdsm: fix Vm cleanup routine
peet at redhat.com
peet at redhat.com
Thu Apr 4 13:28:04 UTC 2013
Peter V. Saveliev has uploaded a new change for review.
Change subject: vdsm: fix Vm cleanup routine
......................................................................
vdsm: fix Vm cleanup routine
The issue was that on Vm disk hot unplug the general clean up routine
was called, that wiped out also qemu and ovirt guest agent's sockets.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=927143
Signed-off-by: Peter V. Saveliev <peet at redhat.com>
Change-Id: Ie355022866d008a83257b1b6e3a4226a07d34c2f
---
M vdsm/libvirtvm.py
M vdsm/vm.py
2 files changed, 20 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/13610/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 40bcd69..6fd269e 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1371,7 +1371,12 @@
self._guestEventTime = self._startTime
def _cleanup(self):
- vm.Vm._cleanup(self)
+ """
+ General clean up routine
+ """
+ self._cleanupDrives()
+ self._cleanupGuestAgent()
+ self._cleanupState()
utils.rmFile(self._qemuguestSocketFile)
def updateGuestCpuRunning(self):
@@ -1871,7 +1876,7 @@
else:
hooks.after_disk_hotunplug(driveXml, self.conf,
params=params.get('custom', {}))
- self._cleanup()
+ self._cleanupDrives()
return {'status': doneCode, 'vmList': self.status()}
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 66ffeb2..197794b 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1030,7 +1030,10 @@
except:
self.log.error("_timedShutdown failed", exc_info=True)
- def _cleanup(self):
+ def _cleanupDrives(self):
+ """
+ Clean up drives related stuff
+ """
with self._volPrepareLock:
for drive in self._devices[DISK_DEVICES]:
try:
@@ -1046,12 +1049,21 @@
except:
pass
+ def _cleanupGuestAgent(self):
+ """
+ Try to stop the guest agent and clean up its socket
+ """
try:
self.guestAgent.stop()
except:
pass
utils.rmFile(self._guestSocketFile)
+
+ def _cleanupState(self):
+ """
+ Clean up state file[s]
+ """
utils.rmFile(self._recoveryFile)
def setDownStatus(self, code, reason):
--
To view, visit http://gerrit.ovirt.org/13610
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie355022866d008a83257b1b6e3a4226a07d34c2f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet at redhat.com>
More information about the vdsm-patches
mailing list