Skip to content
Snippets Groups Projects
Commit 81cfd8e5 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

LUNodeQueryStorage: Use node allocation lock


Block instance allocations when all node locks will be acquired.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent e58009da
No related branches found
No related tags found
No related merge requests found
......@@ -5386,13 +5386,16 @@ class LUNodeQueryStorage(NoHooksLU):
 
def ExpandNames(self):
self.share_locks = _ShareAll()
self.needed_locks = {}
 
if self.op.nodes:
self.needed_locks[locking.LEVEL_NODE] = \
_GetWantedNodes(self, self.op.nodes)
self.needed_locks = {
locking.LEVEL_NODE: _GetWantedNodes(self, self.op.nodes),
}
else:
self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET
self.needed_locks = {
locking.LEVEL_NODE: locking.ALL_SET,
locking.LEVEL_NODE_ALLOC: locking.ALL_SET,
}
 
def Exec(self, feedback_fn):
"""Computes the list of nodes and their attributes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment