Do not allow mounting/umounting LVM PVs.

This commit is contained in:
Andrius Štikonas 2016-09-06 00:14:44 +01:00
parent c480d80273
commit 4b9f34b109
1 changed files with 3 additions and 9 deletions

View File

@ -184,21 +184,15 @@ bool lvm2_pv::unmount(Report& report, const QString& deviceNode)
bool lvm2_pv::canMount(const QString & deviceNode, const QString & mountPoint) const bool lvm2_pv::canMount(const QString & deviceNode, const QString & mountPoint) const
{ {
Q_UNUSED(deviceNode);
Q_UNUSED(mountPoint); Q_UNUSED(mountPoint);
QString rval = getpvField(QStringLiteral("pv_in_use"), deviceNode); // this field return "used" when in use otherwise empty string
if (rval.isEmpty()) {
return true;
}
return false; return false;
} }
bool lvm2_pv::canUnmount(const QString& deviceNode) const bool lvm2_pv::canUnmount(const QString& deviceNode) const
{ {
QString rval = getpvField(QStringLiteral("pv_in_use"), deviceNode); Q_UNUSED(deviceNode);
if (rval.isEmpty()) { return false;
return false;
}
return true;
} }
qint64 lvm2_pv::getTotalPE(const QString& deviceNode) qint64 lvm2_pv::getTotalPE(const QString& deviceNode)