summaryrefslogtreecommitdiff
path: root/hscript/disk.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 13:05:47 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 13:05:47 -0500
commit0d626d668ba6c14022ca88611aff2365cbe4f30c (patch)
treef3312bbf41165733b8edc111618bf82b38cd3cec /hscript/disk.hh
parentbd078146c3b2ab4fb8011e67d9d5c9016bb9d09b (diff)
downloadhorizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.gz
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.bz2
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.xz
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.zip
hscript: Implement lvm_lv, add tests
Diffstat (limited to 'hscript/disk.hh')
-rw-r--r--hscript/disk.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/hscript/disk.hh b/hscript/disk.hh
index a9adba4..43bb56d 100644
--- a/hscript/disk.hh
+++ b/hscript/disk.hh
@@ -145,6 +145,28 @@ public:
};
class LVMVolume : public Key {
+private:
+ const std::string _vg;
+ const std::string _lvname;
+ const SizeType _size_type;
+ const uint64_t _size;
+
+ LVMVolume(int _line, const std::string &_v, const std::string &_n,
+ SizeType _t, uint64_t _s) : Key(_line), _vg(_v), _lvname(_n),
+ _size_type(_t), _size(_s) {}
+public:
+ /*! Retrieve the volume group to which this volume belongs. */
+ const std::string vg() const { return this->_vg; }
+ /*! Retrieve the name of this volume. */
+ const std::string name() const { return this->_lvname; }
+ /*! Retrieve the type of size that this volume uses. */
+ SizeType size_type() const { return this->_size_type; }
+ /*! Retrieve the size of this volume. */
+ uint64_t size() const { return this->_size; }
+
+ static Key *parseFromData(const std::string &, int, int*, int*);
+ bool validate(ScriptOptions) const override;
+ bool execute(ScriptOptions) const override;
};
class Filesystem : public Key {