From 7e55040ecb9f407f88c9869348376b99626f2d90 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Tue, 1 Jul 2008 10:43:21 +0000
Subject: [PATCH] Add REQ_BGL LogicalUnit run requirement

When logical units have REQ_BGL set (it is currently the default) they
need to be the only ganeti operation run on the cluster, and we'll
guarantee it at the master daemon level. Currently only one thread is
running at a time, so this requirement is never broken.

Reviewed-by: iustinp
---
 lib/cmdlib.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index eabd8eb58..e1c575c4c 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -57,6 +57,7 @@ class LogicalUnit(object):
     - optionally redefine their run requirements:
         REQ_MASTER: the LU needs to run on the master node
         REQ_WSSTORE: the LU needs a writable SimpleStore
+        REQ_BGL: the LU needs to hold the Big Ganeti Lock exclusively
 
   Note that all commands require root permissions.
 
@@ -66,6 +67,7 @@ class LogicalUnit(object):
   _OP_REQP = []
   REQ_MASTER = True
   REQ_WSSTORE = False
+  REQ_BGL = True
 
   def __init__(self, processor, op, cfg, sstore):
     """Constructor for LogicalUnit.
-- 
GitLab