Change in vdsm[master]: vm: janitorial: detect if dom is running
fromani at redhat.com
fromani at redhat.com
Mon Jun 9 14:35:27 UTC 2014
Francesco Romani has uploaded a new change for review.
Change subject: vm: janitorial: detect if dom is running
......................................................................
vm: janitorial: detect if dom is running
this patch extracts a little helper method
to detect if the underlying libvirt
domain is running.
Change-Id: If5bd28c43ab934dc5525fc952b646e2bd9b71b78
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/28510/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 3cf4d40..d629b3f 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2849,9 +2849,11 @@
utils.rmFile(self._recoveryFile)
self._guestSockCleanup(self._qemuguestSocketFile)
+ def _isDomainRunning(self):
+ return self._dom.info()[0] == libvirt.VIR_DOMAIN_RUNNING
+
def updateGuestCpuRunning(self):
- self._guestCpuRunning = (self._dom.info()[0] ==
- libvirt.VIR_DOMAIN_RUNNING)
+ self._guestCpuRunning = self._isDomainRunning()
def _getUnderlyingVmDevicesInfo(self):
"""
@@ -2942,8 +2944,7 @@
self._guestSocketFile, self.cif.channelListener, self.log,
connect=utils.tobool(self.conf.get('vmchannel', 'true')))
- self._guestCpuRunning = (self._dom.info()[0] ==
- libvirt.VIR_DOMAIN_RUNNING)
+ self._guestCpuRunning = self._isDomainRunning()
if self.lastStatus not in (vmstatus.MIGRATION_DESTINATION,
vmstatus.RESTORING_STATE):
self._initTimePauseCode = self._readPauseCode(0)
--
To view, visit http://gerrit.ovirt.org/28510
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If5bd28c43ab934dc5525fc952b646e2bd9b71b78
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