Revision 5a904197 src/Ganeti/Types.hs

b/src/Ganeti/Types.hs
459 459
-- | Storage type.
460 460
$(THH.declareLADT ''String "StorageType"
461 461
  [ ("StorageFile", "file")
462
  , ("StorageSharedFile", "sharedfile")
462 463
  , ("StorageLvmPv", "lvm-pv")
463 464
  , ("StorageLvmVg", "lvm-vg")
464 465
  , ("StorageDiskless", "diskless")
......
481 482

  
482 483
-- | Full storage unit with storage-type-specific parameters
483 484
data StorageUnit = SUFile StorageKey
485
                 | SUSharedFile StorageKey
484 486
                 | SULvmPv StorageKey SPExclusiveStorage
485 487
                 | SULvmVg StorageKey SPExclusiveStorage
486 488
                 | SUDiskless StorageKey
......
491 493

  
492 494
instance Show StorageUnit where
493 495
  show (SUFile key) = showSUSimple StorageFile key
496
  show (SUSharedFile key) = showSUSimple StorageSharedFile key
494 497
  show (SULvmPv key es) = showSULvm StorageLvmPv key es
495 498
  show (SULvmVg key es) = showSULvm StorageLvmVg key es
496 499
  show (SUDiskless key) = showSUSimple StorageDiskless key
......
500 503

  
501 504
instance JSON StorageUnit where
502 505
  showJSON (SUFile key) = showJSON (StorageFile, key, []::[String])
506
  showJSON (SUSharedFile key) = showJSON (StorageSharedFile, key, []::[String])
503 507
  showJSON (SULvmPv key es) = showJSON (StorageLvmPv, key, [es])
504 508
  showJSON (SULvmVg key es) = showJSON (StorageLvmVg, key, [es])
505 509
  showJSON (SUDiskless key) = showJSON (StorageDiskless, key, []::[String])
......
525 529
diskTemplateToStorageType :: DiskTemplate -> StorageType
526 530
diskTemplateToStorageType DTExt = StorageExt
527 531
diskTemplateToStorageType DTFile = StorageFile
528
diskTemplateToStorageType DTSharedFile = StorageFile
532
diskTemplateToStorageType DTSharedFile = StorageSharedFile
529 533
diskTemplateToStorageType DTDrbd8 = StorageLvmVg
530 534
diskTemplateToStorageType DTPlain = StorageLvmVg
531 535
diskTemplateToStorageType DTRbd = StorageRados
532 536
diskTemplateToStorageType DTDiskless = StorageDiskless
533 537
diskTemplateToStorageType DTBlock = StorageBlock
534
diskTemplateToStorageType DTGluster = StorageFile
538
diskTemplateToStorageType DTGluster = StorageSharedFile
535 539

  
536 540
-- | Equips a raw storage unit with its parameters
537 541
addParamsToStorageUnit :: SPExclusiveStorage -> StorageUnitRaw -> StorageUnit
......
539 543
addParamsToStorageUnit _ (SURaw StorageDiskless key) = SUDiskless key
540 544
addParamsToStorageUnit _ (SURaw StorageExt key) = SUExt key
541 545
addParamsToStorageUnit _ (SURaw StorageFile key) = SUFile key
546
addParamsToStorageUnit _ (SURaw StorageSharedFile key) = SUSharedFile key
542 547
addParamsToStorageUnit es (SURaw StorageLvmPv key) = SULvmPv key es
543 548
addParamsToStorageUnit es (SURaw StorageLvmVg key) = SULvmVg key es
544 549
addParamsToStorageUnit _ (SURaw StorageRados key) = SURados key

Also available in: Unified diff