hvcDefaults :: Map Hypervisor (Map String PyValueEx)
hvcDefaults =
  Map.fromList
  [ (XenPvm, Map.fromList
             [ (hvUseBootloader,  PyValueEx False)
             , (hvBootloaderPath, PyValueEx xenBootloader)
             , (hvBootloaderArgs, PyValueEx "")
             , (hvKernelPath,     PyValueEx xenKernel)
             , (hvInitrdPath,     PyValueEx "")
             , (hvRootPath,       PyValueEx "/dev/xvda1")
             , (hvKernelArgs,     PyValueEx "ro")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationLive)
             , (hvBlockdevPrefix, PyValueEx "sd")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifScript,      PyValueEx "")
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (XenHvm, Map.fromList
             [ (hvBootOrder,      PyValueEx "cd")
             , (hvCdromImagePath, PyValueEx "")
             , (hvNicType,        PyValueEx htNicRtl8139)
             , (hvDiskType,       PyValueEx htDiskParavirtual)
             , (hvVncBindAddress, PyValueEx ip4AddressAny)
             , (hvAcpi,           PyValueEx True)
             , (hvPae,            PyValueEx True)
             , (hvKernelPath,     PyValueEx "/usr/lib/xen/boot/hvmloader")
             , (hvDeviceModel,    PyValueEx "/usr/lib/xen/bin/qemu-dm")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationNonlive)
             , (hvUseLocaltime,   PyValueEx False)
             , (hvBlockdevPrefix, PyValueEx "hd")
             , (hvPassthrough,    PyValueEx "")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifType,        PyValueEx htHvmVifIoemu)
             , (hvVifScript,      PyValueEx "")
             , (hvViridian,       PyValueEx False)
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (Kvm, Map.fromList
          [ (hvKvmPath,                         PyValueEx kvmPath)
          , (hvKernelPath,                      PyValueEx kvmKernel)
          , (hvInitrdPath,                      PyValueEx "")
          , (hvKernelArgs,                      PyValueEx "ro")
          , (hvRootPath,                        PyValueEx "/dev/vda1")
          , (hvAcpi,                            PyValueEx True)
          , (hvSerialConsole,                   PyValueEx True)
          , (hvSerialSpeed,                     PyValueEx (38400 :: Int))
          , (hvVncBindAddress,                  PyValueEx "")
          , (hvVncTls,                          PyValueEx False)
          , (hvVncX509,                         PyValueEx "")
          , (hvVncX509Verify,                   PyValueEx False)
          , (hvVncPasswordFile,                 PyValueEx "")
          , (hvKvmSpiceBind,                    PyValueEx "")
          , (hvKvmSpiceIpVersion,           PyValueEx ifaceNoIpVersionSpecified)
          , (hvKvmSpicePasswordFile,            PyValueEx "")
          , (hvKvmSpiceLosslessImgCompr,        PyValueEx "")
          , (hvKvmSpiceJpegImgCompr,            PyValueEx "")
          , (hvKvmSpiceZlibGlzImgCompr,         PyValueEx "")
          , (hvKvmSpiceStreamingVideoDetection, PyValueEx "")
          , (hvKvmSpiceAudioCompr,              PyValueEx True)
          , (hvKvmSpiceUseTls,                  PyValueEx False)
          , (hvKvmSpiceTlsCiphers,              PyValueEx opensslCiphers)
          , (hvKvmSpiceUseVdagent,              PyValueEx True)
          , (hvKvmFloppyImagePath,              PyValueEx "")
          , (hvCdromImagePath,                  PyValueEx "")
          , (hvKvmCdrom2ImagePath,              PyValueEx "")
          , (hvBootOrder,                       PyValueEx htBoDisk)
          , (hvNicType,                         PyValueEx htNicParavirtual)
          , (hvDiskType,                        PyValueEx htDiskParavirtual)
          , (hvKvmCdromDiskType,                PyValueEx "")
          , (hvKvmDiskAio,                      PyValueEx htKvmAioThreads)
          , (hvUsbMouse,                        PyValueEx "")
          , (hvKeymap,                          PyValueEx "")
          , (hvMigrationPort,                   PyValueEx (8102 :: Int))
          , (hvMigrationBandwidth,              PyValueEx (32 :: Int))
          , (hvMigrationDowntime,               PyValueEx (30 :: Int))
          , (hvMigrationMode,                   PyValueEx htMigrationLive)
          , (hvUseLocaltime,                    PyValueEx False)
          , (hvDiskCache,                       PyValueEx htCacheDefault)
          , (hvSecurityModel,                   PyValueEx htSmNone)
          , (hvSecurityDomain,                  PyValueEx "")
          , (hvKvmFlag,                         PyValueEx "")
          , (hvVhostNet,                        PyValueEx False)
          , (hvVirtioNetQueues,                 PyValueEx (1 :: Int))
          , (hvKvmUseChroot,                    PyValueEx False)
          , (hvKvmUserShutdown,                 PyValueEx False)
          , (hvMemPath,                         PyValueEx "")
          , (hvRebootBehavior,                  PyValueEx instanceRebootAllowed)
          , (hvCpuMask,                         PyValueEx cpuPinningAll)
          , (hvCpuType,                         PyValueEx "")
          , (hvCpuCores,                        PyValueEx (0 :: Int))
          , (hvCpuThreads,                      PyValueEx (0 :: Int))
          , (hvCpuSockets,                      PyValueEx (0 :: Int))
          , (hvSoundhw,                         PyValueEx "")
          , (hvUsbDevices,                      PyValueEx "")
          , (hvVga,                             PyValueEx "")
          , (hvKvmExtra,                        PyValueEx "")
          , (hvKvmMachineVersion,               PyValueEx "")
          , (hvKvmMigrationCaps,                PyValueEx "")
          , (hvVnetHdr,                         PyValueEx True)])
  , (Fake, Map.fromList [(hvMigrationMode, PyValueEx htMigrationLive)])
  , (Chroot, Map.fromList [(hvInitScript, PyValueEx "/ganeti-chroot")])
  , (Lxc, Map.fromList
          [ (hvCpuMask,             PyValueEx "")
          , (hvLxcCgroupUse,        PyValueEx "")
          , (hvLxcDevices,          PyValueEx lxcDevicesDefault)
          , (hvLxcDropCapabilities, PyValueEx lxcDropCapabilitiesDefault)
          , (hvLxcExtraConfig,      PyValueEx "")
          , (hvLxcTty,              PyValueEx (6 :: Int))
          , (hvLxcStartupWait,      PyValueEx (30 :: Int))
          ])
  ]
hvcDefaults :: Map Hypervisor (Map String PyValueEx)
hvcDefaults =
  Map.fromList
  [ (XenPvm, Map.fromList
             [ (hvUseBootloader,  PyValueEx False)
             , (hvBootloaderPath, PyValueEx xenBootloader)
             , (hvBootloaderArgs, PyValueEx "")
             , (hvKernelPath,     PyValueEx xenKernel)
             , (hvInitrdPath,     PyValueEx "")
             , (hvRootPath,       PyValueEx "/dev/xvda1")
             , (hvKernelArgs,     PyValueEx "ro")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationLive)
             , (hvBlockdevPrefix, PyValueEx "sd")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifScript,      PyValueEx "")
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (XenHvm, Map.fromList
             [ (hvBootOrder,      PyValueEx "cd")
             , (hvCdromImagePath, PyValueEx "")
             , (hvNicType,        PyValueEx htNicRtl8139)
             , (hvDiskType,       PyValueEx htDiskParavirtual)
             , (hvVncBindAddress, PyValueEx ip4AddressAny)
             , (hvAcpi,           PyValueEx True)
             , (hvPae,            PyValueEx True)
             , (hvKernelPath,     PyValueEx "/usr/lib/xen/boot/hvmloader")
             , (hvDeviceModel,    PyValueEx "/usr/lib/xen/bin/qemu-dm")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationNonlive)
             , (hvUseLocaltime,   PyValueEx False)
             , (hvBlockdevPrefix, PyValueEx "hd")
             , (hvPassthrough,    PyValueEx "")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifType,        PyValueEx htHvmVifIoemu)
             , (hvVifScript,      PyValueEx "")
             , (hvViridian,       PyValueEx False)
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (Kvm, Map.fromList
          [ (hvKvmPath,                         PyValueEx kvmPath)
          , (hvKernelPath,                      PyValueEx kvmKernel)
          , (hvInitrdPath,                      PyValueEx "")
          , (hvKernelArgs,                      PyValueEx "ro")
          , (hvRootPath,                        PyValueEx "/dev/vda1")
          , (hvAcpi,                            PyValueEx True)
          , (hvSerialConsole,                   PyValueEx True)
          , (hvSerialSpeed,                     PyValueEx (38400 :: Int))
          , (hvVncBindAddress,                  PyValueEx "")
          , (hvVncTls,                          PyValueEx False)
          , (hvVncX509,                         PyValueEx "")
          , (hvVncX509Verify,                   PyValueEx False)
          , (hvVncPasswordFile,                 PyValueEx "")
          , (hvKvmSpiceBind,                    PyValueEx "")
          , (hvKvmSpiceIpVersion,           PyValueEx ifaceNoIpVersionSpecified)
          , (hvKvmSpicePasswordFile,            PyValueEx "")
          , (hvKvmSpiceLosslessImgCompr,        PyValueEx "")
          , (hvKvmSpiceJpegImgCompr,            PyValueEx "")
          , (hvKvmSpiceZlibGlzImgCompr,         PyValueEx "")
          , (hvKvmSpiceStreamingVideoDetection, PyValueEx "")
          , (hvKvmSpiceAudioCompr,              PyValueEx True)
          , (hvKvmSpiceUseTls,                  PyValueEx False)
          , (hvKvmSpiceTlsCiphers,              PyValueEx opensslCiphers)
          , (hvKvmSpiceUseVdagent,              PyValueEx True)
          , (hvKvmFloppyImagePath,              PyValueEx "")
          , (hvCdromImagePath,                  PyValueEx "")
          , (hvKvmCdrom2ImagePath,              PyValueEx "")
          , (hvBootOrder,                       PyValueEx htBoDisk)
          , (hvNicType,                         PyValueEx htNicParavirtual)
          , (hvDiskType,                        PyValueEx htDiskParavirtual)
          , (hvKvmCdromDiskType,                PyValueEx "")
          , (hvKvmDiskAio,                      PyValueEx htKvmAioThreads)
          , (hvUsbMouse,                        PyValueEx "")
          , (hvKeymap,                          PyValueEx "")
          , (hvMigrationPort,                   PyValueEx (8102 :: Int))
          , (hvMigrationBandwidth,              PyValueEx (32 :: Int))
          , (hvMigrationDowntime,               PyValueEx (30 :: Int))
          , (hvMigrationMode,                   PyValueEx htMigrationLive)
          , (hvUseLocaltime,                    PyValueEx False)
          , (hvDiskCache,                       PyValueEx htCacheDefault)
          , (hvSecurityModel,                   PyValueEx htSmNone)
          , (hvSecurityDomain,                  PyValueEx "")
          , (hvKvmFlag,                         PyValueEx "")
          , (hvVhostNet,                        PyValueEx False)
          , (hvVirtioNetQueues,                 PyValueEx (1 :: Int))
          , (hvKvmUseChroot,                    PyValueEx False)
          , (hvKvmUserShutdown,                 PyValueEx False)
          , (hvMemPath,                         PyValueEx "")
          , (hvRebootBehavior,                  PyValueEx instanceRebootAllowed)
          , (hvCpuMask,                         PyValueEx cpuPinningAll)
          , (hvCpuType,                         PyValueEx "")
          , (hvCpuCores,                        PyValueEx (0 :: Int))
          , (hvCpuThreads,                      PyValueEx (0 :: Int))
          , (hvCpuSockets,                      PyValueEx (0 :: Int))
          , (hvSoundhw,                         PyValueEx "")
          , (hvUsbDevices,                      PyValueEx "")
          , (hvVga,                             PyValueEx "")
          , (hvKvmExtra,                        PyValueEx "")
          , (hvKvmMachineVersion,               PyValueEx "")
          , (hvKvmMigrationCaps,                PyValueEx "")
          , (hvVnetHdr,                         PyValueEx True)])
  , (Fake, Map.fromList [(hvMigrationMode, PyValueEx htMigrationLive)])
  , (Chroot, Map.fromList [(hvInitScript, PyValueEx "/ganeti-chroot")])
  , (Lxc, Map.fromList
          [ (hvCpuMask,             PyValueEx "")
          , (hvLxcCgroupUse,        PyValueEx "")
          , (hvLxcDevices,          PyValueEx lxcDevicesDefault)
          , (hvLxcDropCapabilities, PyValueEx lxcDropCapabilitiesDefault)
          , (hvLxcExtraConfig,      PyValueEx "")
          , (hvLxcTty,              PyValueEx (6 :: Int))
          , (hvLxcStartupWait,      PyValueEx (30 :: Int))
          ])
  ]
hvcDefaults =
  Map.fromList
  [ (XenPvm, Map.fromList
             [ (hvUseBootloader,  PyValueEx False)
             , (hvBootloaderPath, PyValueEx xenBootloader)
             , (hvBootloaderArgs, PyValueEx "")
             , (hvKernelPath,     PyValueEx xenKernel)
             , (hvInitrdPath,     PyValueEx "")
             , (hvRootPath,       PyValueEx "/dev/xvda1")
             , (hvKernelArgs,     PyValueEx "ro")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationLive)
             , (hvBlockdevPrefix, PyValueEx "sd")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifScript,      PyValueEx "")
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (XenHvm, Map.fromList
             [ (hvBootOrder,      PyValueEx "cd")
             , (hvCdromImagePath, PyValueEx "")
             , (hvNicType,        PyValueEx htNicRtl8139)
             , (hvDiskType,       PyValueEx htDiskParavirtual)
             , (hvVncBindAddress, PyValueEx ip4AddressAny)
             , (hvAcpi,           PyValueEx True)
             , (hvPae,            PyValueEx True)
             , (hvKernelPath,     PyValueEx "/usr/lib/xen/boot/hvmloader")
             , (hvDeviceModel,    PyValueEx "/usr/lib/xen/bin/qemu-dm")
             , (hvMigrationPort,  PyValueEx (8002 :: Int))
             , (hvMigrationMode,  PyValueEx htMigrationNonlive)
             , (hvUseLocaltime,   PyValueEx False)
             , (hvBlockdevPrefix, PyValueEx "hd")
             , (hvPassthrough,    PyValueEx "")
             , (hvRebootBehavior, PyValueEx instanceRebootAllowed)
             , (hvCpuMask,        PyValueEx cpuPinningAll)
             , (hvCpuCap,         PyValueEx (0 :: Int))
             , (hvCpuWeight,      PyValueEx (256 :: Int))
             , (hvVifType,        PyValueEx htHvmVifIoemu)
             , (hvVifScript,      PyValueEx "")
             , (hvViridian,       PyValueEx False)
             , (hvXenCmd,         PyValueEx xenCmdXm)
             , (hvXenCpuid,       PyValueEx "")
             , (hvSoundhw,        PyValueEx "")
             ])
  , (Kvm, Map.fromList
          [ (hvKvmPath,                         PyValueEx kvmPath)
          , (hvKernelPath,                      PyValueEx kvmKernel)
          , (hvInitrdPath,                      PyValueEx "")
          , (hvKernelArgs,                      PyValueEx "ro")
          , (hvRootPath,                        PyValueEx "/dev/vda1")
          , (hvAcpi,                            PyValueEx True)
          , (hvSerialConsole,                   PyValueEx True)
          , (hvSerialSpeed,                     PyValueEx (38400 :: Int))
          , (hvVncBindAddress,                  PyValueEx "")
          , (hvVncTls,                          PyValueEx False)
          , (hvVncX509,                         PyValueEx "")
          , (hvVncX509Verify,                   PyValueEx False)
          , (hvVncPasswordFile,                 PyValueEx "")
          , (hvKvmSpiceBind,                    PyValueEx "")
          , (hvKvmSpiceIpVersion,           PyValueEx ifaceNoIpVersionSpecified)
          , (hvKvmSpicePasswordFile,            PyValueEx "")
          , (hvKvmSpiceLosslessImgCompr,        PyValueEx "")
          , (hvKvmSpiceJpegImgCompr,            PyValueEx "")
          , (hvKvmSpiceZlibGlzImgCompr,         PyValueEx "")
          , (hvKvmSpiceStreamingVideoDetection, PyValueEx "")
          , (hvKvmSpiceAudioCompr,              PyValueEx True)
          , (hvKvmSpiceUseTls,                  PyValueEx False)
          , (hvKvmSpiceTlsCiphers,              PyValueEx opensslCiphers)
          , (hvKvmSpiceUseVdagent,              PyValueEx True)
          , (hvKvmFloppyImagePath,              PyValueEx "")
          , (hvCdromImagePath,                  PyValueEx "")
          , (hvKvmCdrom2ImagePath,              PyValueEx "")
          , (hvBootOrder,                       PyValueEx htBoDisk)
          , (hvNicType,                         PyValueEx htNicParavirtual)
          , (hvDiskType,                        PyValueEx htDiskParavirtual)
          , (hvKvmCdromDiskType,                PyValueEx "")
          , (hvKvmDiskAio,                      PyValueEx htKvmAioThreads)
          , (hvUsbMouse,                        PyValueEx "")
          , (hvKeymap,                          PyValueEx "")
          , (hvMigrationPort,                   PyValueEx (8102 :: Int))
          , (hvMigrationBandwidth,              PyValueEx (32 :: Int))
          , (hvMigrationDowntime,               PyValueEx (30 :: Int))
          , (hvMigrationMode,                   PyValueEx htMigrationLive)
          , (hvUseLocaltime,                    PyValueEx False)
          , (hvDiskCache,                       PyValueEx htCacheDefault)
          , (hvSecurityModel,                   PyValueEx htSmNone)
          , (hvSecurityDomain,                  PyValueEx "")
          , (hvKvmFlag,                         PyValueEx "")
          , (hvVhostNet,                        PyValueEx False)
          , (hvVirtioNetQueues,                 PyValueEx (1 :: Int))
          , (hvKvmUseChroot,                    PyValueEx False)
          , (hvKvmUserShutdown,                 PyValueEx False)
          , (hvMemPath,                         PyValueEx "")
          , (hvRebootBehavior,                  PyValueEx instanceRebootAllowed)
          , (hvCpuMask,                         PyValueEx cpuPinningAll)
          , (hvCpuType,                         PyValueEx "")
          , (hvCpuCores,                        PyValueEx (0 :: Int))
          , (hvCpuThreads,                      PyValueEx (0 :: Int))
          , (hvCpuSockets,                      PyValueEx (0 :: Int))
          , (hvSoundhw,                         PyValueEx "")
          , (hvUsbDevices,                      PyValueEx "")
          , (hvVga,                             PyValueEx "")
          , (hvKvmExtra,                        PyValueEx "")
          , (hvKvmMachineVersion,               PyValueEx "")
          , (hvKvmMigrationCaps,                PyValueEx "")
          , (hvVnetHdr,                         PyValueEx True)])
  , (Fake, Map.fromList [(hvMigrationMode, PyValueEx htMigrationLive)])
  , (Chroot, Map.fromList [(hvInitScript, PyValueEx "/ganeti-chroot")])
  , (Lxc, Map.fromList
          [ (hvCpuMask,             PyValueEx "")
          , (hvLxcCgroupUse,        PyValueEx "")
          , (hvLxcDevices,          PyValueEx lxcDevicesDefault)
          , (hvLxcDropCapabilities, PyValueEx lxcDropCapabilitiesDefault)
          , (hvLxcExtraConfig,      PyValueEx "")
          , (hvLxcTty,              PyValueEx (6 :: Int))
          , (hvLxcStartupWait,      PyValueEx (30 :: Int))
          ])
  ]