You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2011/03/25 04:44:29 UTC

svn commit: r1085252 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Author: stroucki
Date: Fri Mar 25 04:44:28 2011
New Revision: 1085252

URL: http://svn.apache.org/viewvc?rev=1085252&view=rev
Log:
qemu.py: Make it possible for snapshot disk data to be put elsewhere, otherwise hosted vms are hosed when the host /tmp fills up

Modified:
    incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1085252&r1=1085251&r2=1085252&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Fri Mar 25 04:44:28 2011
@@ -106,6 +106,8 @@ class Qemu(VmControlInterface):
 		self.migrationSemaphore = threading.Semaphore(int(self.config.get("Qemu", "maxParallelMigrations")))
 		self.stats = {}
 		self.scratchDir = self.config.get("Qemu", "scratchDir")
+		if len(self.scratchDir) == 0:
+			self.scratchDir = "/tmp"
 
 		try:
 			os.mkdir(self.INFO_DIR)
@@ -320,7 +322,6 @@ class Qemu(VmControlInterface):
 	def startVm(self, instance, source):
 		"""Universal function to start a VM -- used by instantiateVM, resumeVM, and prepReceiveVM"""
 
-		
 		#  Capture startVm Hints
 		#  CPU hints
 		cpuModel = instance.hints.get("cpumodel")
@@ -362,7 +363,7 @@ class Qemu(VmControlInterface):
 
 			diskString = diskString + "-drive " + ",".join(thisDiskList) + " "
 
-		# scratch disk (should be probable handled elsewhere)
+		# scratch disk (should be integrated better)
 		scratchSize = instance.hints.get("scratchSpace", "0")
 		scratchSize = int(scratchSize)
 
@@ -443,6 +444,8 @@ class Qemu(VmControlInterface):
 					os.close(i)
 				except:
 					pass
+			# XXXstroucki unfortunately no kvm option yet
+			os.environ['TMPDIR'] = self.scratchDir
 			os.execl(self.QEMU_BIN, *cmd)
 			sys.exit(-1)
 		os.close(pipe_w)