New patch submitted by Eduardo Warszawski (ewarszaw(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/771
commit 7c0002b2a4bcf86961a6126cc52613492464cc7a
Author: Eduardo Warszawski <ewarszaw(a)redhat.com>
Date: Mon Aug 1 20:56:25 2011 +0300
BZ#704131 - Activate all image volumes at once.
Required for performance reasons if the image is depth.
Candidate to the Ugly Patch of the Month.
Change-Id: I8423260ca92eb522239064403d3833002e048375
diff --git a/vdsm/storage/resourceFactories.py b/vdsm/storage/resourceFactories.py
index 0948084..d8ef97b 100644
--- a/vdsm/storage/resourceFactories.py
+++ b/vdsm/storage/resourceFactories.py
@@ -126,6 +126,17 @@ class ImageResourceFactory(rm.SimpleResourceFactory):
volUUIDChain = [vol.volUUID for vol in chain]
volUUIDChain.sort()
+ #Need to activate all volumes in chain at once.
+ #This will repeated down to the flow whitout any consequence, since
+ #lvm.*activateLVs checks if the LV is active before send the lvm cmd.
+ #Remove this whith all the file, since locking volumes instead images
+ #is wrong.
+ #Assumes that chains can not spread into more than one SD.
+ if dom.__class__.__name__ == "BlockStorageDomain":
+ lvm.activateLVs(self.sdUUID, volUUIDChain)
+ #If activateLVs fails we have here a "activation" leak for some of
+ #the volumes.
+
e = None
# Acquire template locks:
# - 'lockType' for template's image itself