Commit c37ca7be authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Instance JSON LockWaiting



...so that it can be used by WConfD who needs to be
able to persist all its data.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 2fb7557f
......@@ -39,9 +39,11 @@ module Ganeti.Locking.Waiting
) where
import Control.Arrow ((&&&))
import Control.Monad (liftM)
import qualified Data.Map as M
import Data.Maybe (fromMaybe)
import qualified Data.Set as S
import qualified Text.JSON as J
import Ganeti.BasicTypes
import qualified Ganeti.Locking.Allocation as L
......@@ -247,3 +249,8 @@ fromExtRepr (alloc, pending) =
fst $ updateLocksWaiting prio owner req s)
(emptyWaiting { lwAllocation = alloc })
pending
instance (Lock a, J.JSON a, Ord b, J.JSON b, Show b, Ord c, J.JSON c)
=> J.JSON (LockWaiting a b c) where
showJSON = J.showJSON . extRepr
readJSON = liftM fromExtRepr . J.readJSON
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment