projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct properties of the cluster's file storage dir
[ganeti-local]
/
src
/
Ganeti
/
Luxi.hs
diff --git
a/src/Ganeti/Luxi.hs
b/src/Ganeti/Luxi.hs
index
9e5b337
..
570992f
100644
(file)
--- a/
src/Ganeti/Luxi.hs
+++ b/
src/Ganeti/Luxi.hs
@@
-77,8
+77,10
@@
import Ganeti.JSON
import Ganeti.OpParams (pTagsObject)
import Ganeti.OpCodes
import qualified Ganeti.Query.Language as Qlang
import Ganeti.OpParams (pTagsObject)
import Ganeti.OpCodes
import qualified Ganeti.Query.Language as Qlang
+import Ganeti.Runtime (GanetiDaemon(..), MiscGroup(..), GanetiGroup(..))
import Ganeti.THH
import Ganeti.Types
import Ganeti.THH
import Ganeti.Types
+import Ganeti.Utils
-- * Utility functions
-- * Utility functions
@@
-119,6
+121,11
@@
$(genLuxiOp "LuxiOp"
, simpleField "fields" [t| [String] |]
, simpleField "lock" [t| Bool |]
])
, simpleField "fields" [t| [String] |]
, simpleField "lock" [t| Bool |]
])
+ , (luxiReqQueryNetworks,
+ [ simpleField "names" [t| [String] |]
+ , simpleField "fields" [t| [String] |]
+ , simpleField "lock" [t| Bool |]
+ ])
, (luxiReqQueryInstances,
[ simpleField "names" [t| [String] |]
, simpleField "fields" [t| [String] |]
, (luxiReqQueryInstances,
[ simpleField "names" [t| [String] |]
, simpleField "fields" [t| [String] |]
@@
-137,10
+144,15
@@
$(genLuxiOp "LuxiOp"
)
, (luxiReqQueryClusterInfo, [])
, (luxiReqQueryTags,
)
, (luxiReqQueryClusterInfo, [])
, (luxiReqQueryTags,
- [ pTagsObject ])
+ [ pTagsObject
+ , simpleField "name" [t| String |]
+ ])
, (luxiReqSubmitJob,
[ simpleField "job" [t| [MetaOpCode] |] ]
)
, (luxiReqSubmitJob,
[ simpleField "job" [t| [MetaOpCode] |] ]
)
+ , (luxiReqSubmitJobToDrainedQueue,
+ [ simpleField "job" [t| [MetaOpCode] |] ]
+ )
, (luxiReqSubmitManyJobs,
[ simpleField "ops" [t| [[MetaOpCode]] |] ]
)
, (luxiReqSubmitManyJobs,
[ simpleField "ops" [t| [[MetaOpCode]] |] ]
)
@@
-217,10
+229,12
@@
getClient path = do
return Client { socket=h, rbuf=rf }
-- | Creates and returns a server endpoint.
return Client { socket=h, rbuf=rf }
-- | Creates and returns a server endpoint.
-getServer :: FilePath -> IO S.Socket
-getServer path = do
+getServer :: Bool -> FilePath -> IO S.Socket
+getServer setOwner path = do
s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
S.bindSocket s (S.SockAddrUnix path)
s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
S.bindSocket s (S.SockAddrUnix path)
+ when setOwner . setOwnerAndGroupFromNames path GanetiLuxid $
+ ExtraGroup DaemonsGroup
S.listen s 5 -- 5 is the max backlog
return s
S.listen s 5 -- 5 is the max backlog
return s
@@
-341,6
+355,9
@@
decodeCall (LuxiCall call args) =
return $ QueryGroups names fields locking
ReqQueryClusterInfo ->
return QueryClusterInfo
return $ QueryGroups names fields locking
ReqQueryClusterInfo ->
return QueryClusterInfo
+ ReqQueryNetworks -> do
+ (names, fields, locking) <- fromJVal args
+ return $ QueryNetworks names fields locking
ReqQuery -> do
(what, fields, qfilter) <- fromJVal args
return $ Query what fields qfilter
ReqQuery -> do
(what, fields, qfilter) <- fromJVal args
return $ Query what fields qfilter
@@
-354,6
+371,10
@@
decodeCall (LuxiCall call args) =
[ops1] <- fromJVal args
ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1
return $ SubmitJob ops2
[ops1] <- fromJVal args
ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1
return $ SubmitJob ops2
+ ReqSubmitJobToDrainedQueue -> do
+ [ops1] <- fromJVal args
+ ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1
+ return $ SubmitJobToDrainedQueue ops2
ReqSubmitManyJobs -> do
[ops1] <- fromJVal args
ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1
ReqSubmitManyJobs -> do
[ops1] <- fromJVal args
ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1
@@
-387,8
+408,7
@@
decodeCall (LuxiCall call args) =
return $ QueryConfigValues fields
ReqQueryTags -> do
(kind, name) <- fromJVal args
return $ QueryConfigValues fields
ReqQueryTags -> do
(kind, name) <- fromJVal args
- item <- tagObjectFrom kind name
- return $ QueryTags item
+ return $ QueryTags kind name
ReqCancelJob -> do
[jid] <- fromJVal args
return $ CancelJob jid
ReqCancelJob -> do
[jid] <- fromJVal args
return $ CancelJob jid