Add removeVG lvmdevice. And, Change createVG to accpeting QStringList instead.
This commit is contained in:
parent
8b48406200
commit
016daaa75d
|
@ -321,15 +321,23 @@ 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)
|
||||
bool LvmDevice::createVG(Report& report, const QString vgname, const QStringList 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();
|
||||
foreach (QString pvnode, pvlist) {
|
||||
args << pvnode;
|
||||
}
|
||||
ExternalCommand cmd(report, QStringLiteral("lvm"), args);
|
||||
|
||||
return (cmd.run(-1) && cmd.exitCode() == 0);
|
||||
}
|
||||
|
||||
bool LvmDevice::removeVG(Report& report, const QString vgname)
|
||||
{
|
||||
ExternalCommand cmd(report, QStringLiteral("lvm"),
|
||||
{ QStringLiteral("vgremove"),
|
||||
vgname });
|
||||
return (cmd.run(-1) && cmd.exitCode() == 0);
|
||||
}
|
||||
|
|
|
@ -68,7 +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);
|
||||
static bool createVG(Report& report, const QString vgname, const QStringList pvlist);
|
||||
static bool removeVG(Report& report, const QString vgname);
|
||||
|
||||
protected:
|
||||
void initPartitions();
|
||||
|
|
Loading…
Reference in New Issue