Store list of physical volumes in a global variable.
This commit is contained in:
parent
36202cc1ad
commit
5d2bb2f8af
|
@ -66,7 +66,7 @@ void DeviceScanner::scan()
|
||||||
|
|
||||||
const QList<Device*> deviceList = CoreBackendManager::self()->backend()->scanDevices();
|
const QList<Device*> deviceList = CoreBackendManager::self()->backend()->scanDevices();
|
||||||
const QList<LvmDevice*> lvmList = LvmDevice::scanSystemLVM();
|
const QList<LvmDevice*> lvmList = LvmDevice::scanSystemLVM();
|
||||||
operationStack().physicalVolumes() = FS::lvm2_pv::getPVs(deviceList);
|
LVM::pvList = FS::lvm2_pv::getPVs(deviceList);
|
||||||
|
|
||||||
for (const auto &d : deviceList)
|
for (const auto &d : deviceList)
|
||||||
operationStack().addDevice(d);
|
operationStack().addDevice(d);
|
||||||
|
@ -75,12 +75,12 @@ void DeviceScanner::scan()
|
||||||
|
|
||||||
for (const auto &d : lvmList) {
|
for (const auto &d : lvmList) {
|
||||||
operationStack().addDevice(d);
|
operationStack().addDevice(d);
|
||||||
operationStack().physicalVolumes().append(FS::lvm2_pv::getPVinNode(d->partitionTable()));
|
LVM::pvList.append(FS::lvm2_pv::getPVinNode(d->partitionTable()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store list of physical volumes in LvmDevice
|
// Store list of physical volumes in LvmDevice
|
||||||
for (const auto &d : lvmList)
|
for (const auto &d : lvmList)
|
||||||
for (const auto &p : operationStack().physicalVolumes())
|
for (const auto &p : LVM::pvList) // FIXME: qAsConst
|
||||||
if (p.vgName() == d->name())
|
if (p.vgName() == d->name())
|
||||||
d->physicalVolumes().append(p.partition());
|
d->physicalVolumes().append(p.partition());
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#define OPERATIONSTACK__H
|
#define OPERATIONSTACK__H
|
||||||
|
|
||||||
#include "fs/lvm2_pv.h"
|
|
||||||
#include "util/libpartitionmanagerexport.h"
|
#include "util/libpartitionmanagerexport.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -75,13 +74,6 @@ public:
|
||||||
return m_PreviewDevices; /**< @return the list of Devices */
|
return m_PreviewDevices; /**< @return the list of Devices */
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<LvmPV>& physicalVolumes() {
|
|
||||||
return m_LVMPhysicalVolumes; /**< @return the list of LVM PVs */
|
|
||||||
}
|
|
||||||
const QList<LvmPV>& physicalVolumes() const {
|
|
||||||
return m_LVMPhysicalVolumes; /**< @return the list of LVM PVs */
|
|
||||||
}
|
|
||||||
|
|
||||||
Operations& operations() {
|
Operations& operations() {
|
||||||
return m_Operations; /**< @return the list of operations */
|
return m_Operations; /**< @return the list of operations */
|
||||||
}
|
}
|
||||||
|
@ -110,7 +102,6 @@ protected:
|
||||||
private:
|
private:
|
||||||
Operations m_Operations;
|
Operations m_Operations;
|
||||||
mutable Devices m_PreviewDevices;
|
mutable Devices m_PreviewDevices;
|
||||||
mutable QList<LvmPV> m_LVMPhysicalVolumes;
|
|
||||||
QReadWriteLock m_Lock;
|
QReadWriteLock m_Lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -289,6 +289,8 @@ QList<LvmPV> lvm2_pv::getPVs(const QList<Device*>& devices)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<LvmPV> LVM::pvList;
|
||||||
|
|
||||||
LvmPV::LvmPV(const QString vgName, const Partition* p, bool isLuks)
|
LvmPV::LvmPV(const QString vgName, const Partition* p, bool isLuks)
|
||||||
: m_vgName(vgName)
|
: m_vgName(vgName)
|
||||||
, m_p(p)
|
, m_p(p)
|
||||||
|
|
|
@ -57,6 +57,9 @@ private:
|
||||||
bool m_isLuks;
|
bool m_isLuks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace LVM {
|
||||||
|
extern LIBKPMCORE_EXPORT QList<LvmPV> pvList;
|
||||||
|
}
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue