incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1236402 - in /incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager: nodemanagerservice.py vmcontrol/qemu.py
Date Thu, 26 Jan 2012 21:48:14 GMT
Author: stroucki
Date: Thu Jan 26 21:48:14 2012
New Revision: 1236402

URL: http://svn.apache.org/viewvc?rev=1236402&view=rev
Log:
qemu: (cosmetic)
nodemanagerservice: avoid race condition when starting VM 

Modified:
    incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
    incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py?rev=1236402&r1=1236401&r2=1236402&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
(original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
Thu Jan 26 21:48:14 2012
@@ -224,9 +224,17 @@ class NodeManagerService(object):
 
 	def __getInstance(self, vmId):
 		instance = self.instances.get(vmId, None)
-		if (instance is None):
-			raise TashiException(d={'errno':Errors.NoSuchVmId,'msg':"There is no vmId %d on this host"
% (vmId)})
-		return instance
+		if instance is not None:
+			return instance
+
+		# refresh self.instances if not found
+		self.__loadVmInfo()
+		instance = self.instances.get(vmId, None)
+		if instance is not None:
+			return instance
+
+
+		raise TashiException(d={'errno':Errors.NoSuchVmId,'msg':"There is no vmId %d on this host"
% (vmId)})
 	
 	# remote
 	# Called from VMM to update self.instances

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1236402&r1=1236401&r2=1236402&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py Thu
Jan 26 21:48:14 2012
@@ -621,7 +621,7 @@ class Qemu(VmControlInterface):
 			self.nm.vmStateChange(vmId, None, InstanceState.Running)
 			# XXXstroucki Should make sure Running state is saved
 			# otherwise on restart it will appear as Activating
-			# until we update the state in __matchSystemPids
+			# until we update the state in __matchHostPids
 			child.instance.state = InstanceState.Running
 			self.__saveChildInfo(child)
 			return vmId



Mime
View raw message