Add LvmDevice createVG.
This commit is contained in:
parent
0ab8227d94
commit
2770da7da6
|
@ -320,3 +320,16 @@ bool LvmDevice::insertPV(Report& report, LvmDevice& dev, const QString& pvPath)
|
|||
|
||||
return (cmd.run(-1) && cmd.exitCode() == 0);
|
||||
}
|
||||
|
||||
bool LvmDevice::createVG(Report& report, const QString vgname, const QList<Partition*> pvlist)
|
||||
{
|
||||
//TODO: check that all the pv in pvlist is lvm2_pv
|
||||
QStringList args = QStringList();
|
||||
args << QStringLiteral("vgcreate") << vgname;
|
||||
foreach (Partition* p, pvlist) {
|
||||
args << p->partitionPath();
|
||||
}
|
||||
ExternalCommand cmd(report, QStringLiteral("lvm"), args);
|
||||
|
||||
return (cmd.run(-1) && cmd.exitCode() == 0);
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
static bool removePV(Report& report, LvmDevice& dev, const QString& pvPath);
|
||||
static bool insertPV(Report& report, LvmDevice& dev, const QString& pvPath);
|
||||
|
||||
static bool createVG(Report& report, const QString vgname, const QList<Partition*> pvlist);
|
||||
|
||||
protected:
|
||||
void initPartitions();
|
||||
QList<QString> deviceNodeList() const override;
|
||||
|
|
Loading…
Reference in New Issue