incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1044878 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Sun, 12 Dec 2010 18:45:48 GMT
Author: stroucki
Date: Sun Dec 12 18:45:48 2010
New Revision: 1044878

URL: http://svn.apache.org/viewvc?rev=1044878&view=rev
Log:
allow use of virtio disks

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=1044878&r1=1044877&r2=1044878&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Sun Dec 12 18:45:48 2010
@@ -334,16 +334,28 @@ class Qemu(VmControlInterface):
 			disk = instance.disks[index]
 			uri = scrubString(disk.uri)
 			imageLocal = self.dfs.getLocalHandle("images/" + uri)
+			thisDiskList = [ "file=%s" % imageLocal ]
+			thisDiskList.append("if=%s" % diskInterface")
+			thisDiskList.append("index=%d" % index")
+
+			if (diskInterface == "virtio"):
+				thisDiskList.append("boot=on")
+
 			if (disk.persistent):
 				snapshot = "off"
 				migrate = "off"
 			else:
 				snapshot = "on"
 				migrate = "on"
+
+			thisDiskList.append("snapshot=%s" % snapshot)
+
 			if (self.useMigrateArgument):
-				diskString = diskString + "-drive file=%s,if=%s,index=%d,snapshot=%s,migrate=%s,media=disk
" % (imageLocal, diskInterface, index, snapshot, migrate)
-			else:
-				diskString = diskString + "-drive file=%s,if=%s,index=%d,snapshot=%s,media=disk " % (imageLocal,
diskInterface, index, snapshot)
+				thisDiskList.append("migrate=%s" % migrate)
+
+			diskString = diskString + "-drive " + ",".join(thisDiskList) + " "
+
+
 		#  Nic hints
 		nicModel = instance.hints.get("nicModel", "e1000")
 		nicString = ""



Mime
View raw message