Skip to content
Snippets Groups Projects
Commit 551b44e2 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a function to change an OpCode's priority


This simply updates the metaopcode submit priority.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent d41f6558
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{- {-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc. Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -44,6 +44,7 @@ module Ganeti.OpCodes ...@@ -44,6 +44,7 @@ module Ganeti.OpCodes
, MetaOpCode(..) , MetaOpCode(..)
, wrapOpCode , wrapOpCode
, setOpComment , setOpComment
, setOpPriority
) where ) where
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
...@@ -667,3 +668,8 @@ wrapOpCode = MetaOpCode defOpParams ...@@ -667,3 +668,8 @@ wrapOpCode = MetaOpCode defOpParams
setOpComment :: String -> MetaOpCode -> MetaOpCode setOpComment :: String -> MetaOpCode -> MetaOpCode
setOpComment comment (MetaOpCode common op) = setOpComment comment (MetaOpCode common op) =
MetaOpCode (common { opComment = Just comment}) op MetaOpCode (common { opComment = Just comment}) op
-- | Sets the priority on a meta opcode.
setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCode
setOpPriority prio (MetaOpCode common op) =
MetaOpCode (common { opPriority = prio }) op
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