A small dirty hack to keep track of all the PVs that to be added to any VG.
This commit is contained in:
parent
6915187fb2
commit
25bbce4975
|
@ -56,6 +56,8 @@ LvmDevice::LvmDevice(const QString& name, const QString& iconname)
|
||||||
initPartitions();
|
initPartitions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList LvmDevice::s_DirtyPVs;
|
||||||
|
|
||||||
LvmDevice::~LvmDevice()
|
LvmDevice::~LvmDevice()
|
||||||
{
|
{
|
||||||
delete m_PVPathList;
|
delete m_PVPathList;
|
||||||
|
|
|
@ -53,6 +53,7 @@ public:
|
||||||
Partition* scanPartition(const QString& lvPath, PartitionTable* pTable) const;
|
Partition* scanPartition(const QString& lvPath, PartitionTable* pTable) const;
|
||||||
QStringList deviceNodeList() const override;
|
QStringList deviceNodeList() const override;
|
||||||
QStringList lvPathList() const;
|
QStringList lvPathList() const;
|
||||||
|
static QStringList s_DirtyPVs;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QList<LvmDevice*> scanSystemLVM();
|
static QList<LvmDevice*> scanSystemLVM();
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
*/
|
*/
|
||||||
CreateVolumeGroupOperation::CreateVolumeGroupOperation(const QString& vgname, const QStringList& pvlist, const qint32 pesize) :
|
CreateVolumeGroupOperation::CreateVolumeGroupOperation(const QString& vgname, const QStringList& pvlist, const qint32 pesize) :
|
||||||
Operation(),
|
Operation(),
|
||||||
m_CreateVolumeGroupJob(new CreateVolumeGroupJob(vgname, pvlist, pesize))
|
m_CreateVolumeGroupJob(new CreateVolumeGroupJob(vgname, pvlist, pesize)),
|
||||||
|
m_PVList(pvlist)
|
||||||
{
|
{
|
||||||
addJob(createVolumeGroupJob());
|
addJob(createVolumeGroupJob());
|
||||||
}
|
}
|
||||||
|
@ -50,10 +51,16 @@ bool CreateVolumeGroupOperation::targets(const Partition& part) const
|
||||||
|
|
||||||
void CreateVolumeGroupOperation::preview()
|
void CreateVolumeGroupOperation::preview()
|
||||||
{
|
{
|
||||||
|
LvmDevice::s_DirtyPVs << PVList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateVolumeGroupOperation::undo()
|
void CreateVolumeGroupOperation::undo()
|
||||||
{
|
{
|
||||||
|
foreach(QString pvpath, PVList()) {
|
||||||
|
if (LvmDevice::s_DirtyPVs.contains(pvpath)) {
|
||||||
|
LvmDevice::s_DirtyPVs.removeAll(pvpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreateVolumeGroupOperation::canCreate()
|
bool CreateVolumeGroupOperation::canCreate()
|
||||||
|
|
|
@ -61,8 +61,13 @@ protected:
|
||||||
return m_CreateVolumeGroupJob;
|
return m_CreateVolumeGroupJob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList PVList() {
|
||||||
|
return m_PVList;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CreateVolumeGroupJob* m_CreateVolumeGroupJob;
|
CreateVolumeGroupJob* m_CreateVolumeGroupJob;
|
||||||
|
QStringList m_PVList;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue