From f9556d33d972da4216f543b1cae799573ec3d0ca Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sun, 25 Nov 2012 23:58:31 +0100
Subject: [PATCH] Replace hand-coded 'live' field of OpInstanceMigrate

This is the last inline-written field; I've done it separately from
the last patch due to changes being needed in HTools (field changed
type).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
---
 htools/Ganeti/HTools/Cluster.hs | 5 +++--
 htools/Ganeti/OpCodes.hs        | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/htools/Ganeti/HTools/Cluster.hs b/htools/Ganeti/HTools/Cluster.hs
index 0aea8459c..09509f762 100644
--- a/htools/Ganeti/HTools/Cluster.hs
+++ b/htools/Ganeti/HTools/Cluster.hs
@@ -1453,8 +1453,9 @@ iMoveToJob nl il idx move =
                       Bad msg -> error $ "Empty node name for idx " ++
                                  show n ++ ": " ++ msg ++ "??"
                       Ok ne -> Just ne
-      opF = OpCodes.OpInstanceMigrate iname True False True Nothing
-      opFA n = OpCodes.OpInstanceMigrate iname True False True (lookNode n)
+      live = Just True
+      opF = OpCodes.OpInstanceMigrate iname live False True Nothing
+      opFA n = OpCodes.OpInstanceMigrate iname live False True (lookNode n)
       opR n = OpCodes.OpInstanceReplaceDisks iname (lookNode n)
               OpCodes.ReplaceNewSecondary [] Nothing
   in case move of
diff --git a/htools/Ganeti/OpCodes.hs b/htools/Ganeti/OpCodes.hs
index 5b52a3802..30f2c7ee0 100644
--- a/htools/Ganeti/OpCodes.hs
+++ b/htools/Ganeti/OpCodes.hs
@@ -70,7 +70,7 @@ $(genOpCode "OpCode"
      ])
   , ("OpInstanceMigrate",
      [ pInstanceName
-     , simpleField "live"           [t| Bool   |]
+     , pMigrationLive
      , pMigrationCleanup
      , pAllowFailover
      , pMigrationTargetNode
-- 
GitLab