Revision e0cd6f5d src/Ganeti/HsConstants.hs

b/src/Ganeti/HsConstants.hs
231 231
sshConsoleUser :: String
232 232
sshConsoleUser = AutoConf.sshConsoleUser
233 233

  
234
-- * Cpu pinning separators and constants
235

  
236
cpuPinningSep :: String
237
cpuPinningSep = ":"
238

  
239
cpuPinningAll :: String
240
cpuPinningAll = "all"
241

  
242
-- | Internal representation of "all"
243
cpuPinningAllVal :: Int
244
cpuPinningAllVal = -1
245

  
246
-- | One "all" entry in a CPU list means CPU pinning is off
247
cpuPinningOff :: [Int]
248
cpuPinningOff = [cpuPinningAllVal]
249

  
250
-- | A Xen-specific implementation detail is that there is no way to
251
-- actually say "use any cpu for pinning" in a Xen configuration file,
252
-- as opposed to the command line, where you can say
253
-- @
254
-- xm vcpu-pin <domain> <vcpu> all
255
-- @
256
--
257
-- The workaround used in Xen is "0-63" (see source code function
258
-- "xm_vcpu_pin" in @<xen-source>/tools/python/xen/xm/main.py@).
259
--
260
-- To support future changes, the following constant is treated as a
261
-- blackbox string that simply means "use any cpu for pinning under
262
-- xen".
263
cpuPinningAllXen :: String
264
cpuPinningAllXen = "0-63"
265

  
266
-- | A KVM-specific implementation detail - the following value is
267
-- used to set CPU affinity to all processors (--0 through --31), per
268
-- taskset man page.
269
--
270
-- FIXME: This only works for machines with up to 32 CPU cores
271
cpuPinningAllKvm :: Int
272
cpuPinningAllKvm = 0xFFFFFFFF
273

  
234 274
-- * Wipe
235 275

  
236 276
ddCmd :: String

Also available in: Unified diff