commit 3b170ad43c96358339e9a10363893cc9a6a159c4
Author: Jose A. Lopes <jabolopes@google.com>
Date:   Fri Sep 20 15:58:36 2013 +0200

    Hs2Py constants: add all 'AutoConf' and related constants
    
    Add all constants in 'AutoConf' to the Hs2Py constant generation and
    'socatEscapeCode' because it is part of the group containing
    'socatPath', 'socatUseCompress', and 'socatUseEscape'.
    
    Signed-off-by: Jose A. Lopes <jabolopes@google.com>
    Reviewed-by: Thomas Thrainer <thomasth@google.com>

diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs
index 545c30b..43b3668 100644
--- a/src/Ganeti/HsConstants.hs
+++ b/src/Ganeti/HsConstants.hs
@@ -40,7 +40,7 @@ import Data.Map (Map)
 import qualified Data.Map as Map (fromList)
 
 import AutoConf
-import Ganeti.ConstantUtils (FrozenSet, Protocol(..))
+import Ganeti.ConstantUtils (FrozenSet, Protocol(..), buildVersion)
 import qualified Ganeti.ConstantUtils as ConstantUtils
 import Ganeti.Runtime (GanetiDaemon(..), MiscGroup(..), GanetiGroup(..),
                        ExtraLogReason(..))
@@ -50,6 +50,41 @@ import qualified Ganeti.Runtime as Runtime
 import Ganeti.Types
 import qualified Ganeti.Types as Types
 
+-- * 'autoconf' constants for Python only
+
+drbdBarriers :: String
+drbdBarriers = AutoConf.drbdBarriers
+
+drbdNoMetaFlush :: Bool
+drbdNoMetaFlush = AutoConf.drbdNoMetaFlush
+
+lvmStripecount :: Int
+lvmStripecount = AutoConf.lvmStripecount
+
+-- * Various versions
+
+releaseVersion :: String
+releaseVersion = AutoConf.packageVersion
+
+configMajor :: Int
+configMajor = AutoConf.versionMajor
+
+configMinor :: Int
+configMinor = AutoConf.versionMinor
+
+-- | The configuration is supposed to remain stable across
+-- revisions. Therefore, the revision number is cleared to '0'.
+configRevision :: Int
+configRevision = 0
+
+configVersion :: Int
+configVersion = buildVersion configMajor configMinor configRevision
+
+-- | Similarly to the configuration (see 'configRevision'), the
+-- protocols are supposed to remain stable across revisions.
+protocolVersion :: Int
+protocolVersion = buildVersion configMajor configMinor configRevision
+
 -- * Constants for 'lib/pathutils.py'
 
 osSearchPath :: [String]
@@ -107,6 +142,20 @@ sshLoginUser = AutoConf.sshLoginUser
 sshConsoleUser :: String
 sshConsoleUser = AutoConf.sshConsoleUser
 
+-- * 'autoconf' enable/disable
+
+enableConfd :: Bool
+enableConfd = AutoConf.enableConfd
+
+enableMond :: Bool
+enableMond = AutoConf.enableMond
+
+enableRestrictedCommands :: Bool
+enableRestrictedCommands = AutoConf.enableRestrictedCommands
+
+enableSplitQuery :: Bool
+enableSplitQuery = AutoConf.enableSplitQuery
+
 -- * SSH constants
 
 ssh :: String
@@ -217,6 +266,26 @@ xenKernel = AutoConf.xenKernel
 knownXenCommands :: FrozenSet String
 knownXenCommands = ConstantUtils.mkSet [xenCmdXl, xenCmdXm]
 
+-- * KVM and socat
+
+kvmPath :: String
+kvmPath = AutoConf.kvmPath
+
+kvmKernel :: String
+kvmKernel = AutoConf.kvmKernel
+
+socatEscapeCode :: String
+socatEscapeCode = "0x1d"
+
+socatPath :: String
+socatPath = AutoConf.socatPath
+
+socatUseCompress :: Bool
+socatUseCompress = AutoConf.socatUseCompress
+
+socatUseEscape :: Bool
+socatUseEscape = AutoConf.socatUseEscape
+
 -- * Storage types
 
 stBlock :: String
@@ -429,6 +498,13 @@ maxTagsPerObj = 4096
 nodeMaxClockSkew :: Int
 nodeMaxClockSkew = 150
 
+-- | Disk index separator
+diskSeparator :: String
+diskSeparator = AutoConf.diskSeparator
+
+ipCommandPath :: String
+ipCommandPath = AutoConf.ipPath
+
 -- * Reboot types
 
 instanceRebootSoft :: String
@@ -1174,6 +1250,17 @@ validAllocPolicies = map Types.allocPolicyToRaw [minBound..]
 blockdevDriverManual :: String
 blockdevDriverManual = Types.blockDriverToRaw BlockDrvManual
 
+-- | 'qemu-img' path, required for 'ovfconverter'
+qemuimgPath :: String
+qemuimgPath = AutoConf.qemuimgPath
+
+-- | Whether htools was enabled at compilation time
+--
+-- FIXME: this should be moved next to the other enable constants,
+-- such as, 'enableConfd', and renamed to 'enableHtools'.
+htools :: Bool
+htools = AutoConf.htools
+
 -- | Path generating random UUID
 randomUuidFile :: String
 randomUuidFile = ConstantUtils.randomUuidFile
