Handle case when the to-be-moved PV is not used.

This commit is contained in:
Chantara Tith 2016-07-09 18:50:00 +07:00
parent 5a36f03632
commit 930f936b8c
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "core/lvmdevice.h"
#include "fs/filesystem.h"
#include "fs/lvm2_pv.h"
#include "fs/filesystemfactory.h"
#include "core/partition.h"
@ -335,6 +336,11 @@ bool LvmDevice::insertPV(Report& report, LvmDevice& dev, const QString& pvPath)
bool LvmDevice::movePV(Report& report, LvmDevice& dev, const QString& pvPath)
{
Q_UNUSED(dev);
if (FS::lvm2_pv::getAllocatedPE(pvPath) <= 0) {
return true;
}
ExternalCommand cmd(report, QStringLiteral("lvm"),
{ QStringLiteral("pvmove"),
pvPath});