LVM support #6

Closed
andrius wants to merge 109 commits from (deleted):lvm-support-rebase into master
2 changed files with 15 additions and 0 deletions
Showing only changes of commit 2770da7da6 - Show all commits

View File

@ -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);
}

View File

@ -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;