projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More code reorganizations
[ganeti-local]
/
Ganeti
/
HTools
/
Node.hs
diff --git
a/Ganeti/HTools/Node.hs
b/Ganeti/HTools/Node.hs
index
8dffd58
..
c5856fb
100644
(file)
--- a/
Ganeti/HTools/Node.hs
+++ b/
Ganeti/HTools/Node.hs
@@
-26,6
+26,9
@@
module Ganeti.HTools.Node
, setSec
-- * Formatting
, list
, setSec
-- * Formatting
, list
+ -- * Misc stuff
+ , AssocList
+ , noSecondary
) where
import Data.List
) where
import Data.List
@@
-35,8
+38,6
@@
import qualified Ganeti.HTools.Container as Container
import qualified Ganeti.HTools.Instance as Instance
import qualified Ganeti.HTools.PeerMap as PeerMap
import qualified Ganeti.HTools.Instance as Instance
import qualified Ganeti.HTools.PeerMap as PeerMap
-import Ganeti.HTools.Utils
-
data Node = Node { t_mem :: Double -- ^ total memory (MiB)
, n_mem :: Int -- ^ node memory (MiB)
, f_mem :: Int -- ^ free memory (MiB)
data Node = Node { t_mem :: Double -- ^ total memory (MiB)
, n_mem :: Int -- ^ node memory (MiB)
, f_mem :: Int -- ^ free memory (MiB)
@@
-58,6
+59,13
@@
data Node = Node { t_mem :: Double -- ^ total memory (MiB)
-- score computations
} deriving (Show)
-- score computations
} deriving (Show)
+-- | A simple name for the int, node association list
+type AssocList = [(Int, Node)]
+
+-- | Constant node index for a non-moveable instance
+noSecondary :: Int
+noSecondary = -1
+
{- | Create a new node.
The index and the peers maps are empty, and will be need to be update
{- | Create a new node.
The index and the peers maps are empty, and will be need to be update