Commit eabbda6f authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Make disk size a special numerical field



For disk sizes, instead of plain numbers (naming the value in MiB),
also accept expressions with units like 'GiB'.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent ba0d1405
......@@ -265,6 +265,7 @@ import Text.JSON.Pretty (pp_value)
import Ganeti.BasicTypes
import qualified Ganeti.Constants as C
import Ganeti.THH
import Ganeti.Utils
import Ganeti.JSON
import Ganeti.Types
import qualified Ganeti.Query.Language as Qlang
......@@ -342,9 +343,10 @@ $(buildObject "INicParams" "inic"
, optionalField $ simpleField C.inicBridge [t| NonEmptyString |]
])
-- | Disk modification definition. FIXME: disksize should be VTYPE_UNIT.
-- | Disk modification definition.
$(buildObject "IDiskParams" "idisk"
[ optionalField $ simpleField C.idiskSize [t| Int |]
[ specialNumericalField 'parseUnitAssumeBinary . optionalField
$ simpleField C.idiskSize [t| Int |]
, optionalField $ simpleField C.idiskMode [t| DiskAccess |]
, optionalField $ simpleField C.idiskAdopt [t| NonEmptyString |]
, optionalField $ simpleField C.idiskVg [t| NonEmptyString |]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment