LVM support #6

Closed
andrius wants to merge 109 commits from (deleted):lvm-support-rebase into master
1 changed files with 8 additions and 1 deletions
Showing only changes of commit 90e5e9c83e - Show all commits

View File

@ -395,8 +395,15 @@ bool LvmDevice::createVG(Report& report, const QString vgname, const QStringList
bool LvmDevice::removeVG(Report& report, LvmDevice& dev)
{
bool deactivated = false;
ExternalCommand deactivate(report, QStringLiteral("lvm"),
{ QStringLiteral("vgchange"),
QStringLiteral("--activate"), QStringLiteral("n"),
dev.name() });
deactivated = deactivate.run(-1) && deactivate.exitCode() == 0;
ExternalCommand cmd(report, QStringLiteral("lvm"),
{ QStringLiteral("vgremove"),
dev.name() });
return (cmd.run(-1) && cmd.exitCode() == 0);
return (deactivated && cmd.run(-1) && cmd.exitCode() == 0);
}