Including fail and remove PV methods for RAID shrinking
This commit is contained in:
parent
6ab2143158
commit
355c37097a
|
@ -580,6 +580,24 @@ QString SoftwareRAID::getDefaultRaidConfigFile()
|
|||
return QString();
|
||||
}
|
||||
|
||||
bool SoftwareRAID::failPV(Report& report, const QString& devicePath, const QString& physicalVolume)
|
||||
{
|
||||
ExternalCommand cmd(QStringLiteral("mdadm"),
|
||||
{ QStringLiteral("--manage"), QStringLiteral("--fail"), devicePath, physicalVolume });
|
||||
|
||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||
}
|
||||
|
||||
bool SoftwareRAID::removePV(Report& report, const QString& devicePath, const QString& physicalVolume)
|
||||
{
|
||||
failPV(report, devicePath, physicalVolume);
|
||||
|
||||
ExternalCommand cmd(QStringLiteral("mdadm"),
|
||||
{ QStringLiteral("--manage"), QStringLiteral("--remove"), devicePath, physicalVolume });
|
||||
|
||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||
}
|
||||
|
||||
void SoftwareRAID::setPartitionNodes(const QStringList& partitionNodes)
|
||||
{
|
||||
d_ptr->m_partitionPathList = partitionNodes;
|
||||
|
|
|
@ -94,6 +94,12 @@ public:
|
|||
|
||||
static QString getDefaultRaidConfigFile();
|
||||
|
||||
static bool failPV(Report& report, const QString& devicePath, const QString& physicalVolume);
|
||||
|
||||
//static bool insertPV(Report& report, SoftwareRAID& raid, const QString& deviceNode);
|
||||
|
||||
static bool removePV(Report& report, const QString& devicePath, const QString& physicalVolume);
|
||||
|
||||
protected:
|
||||
void initPartitions() override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue