Remove ResizeVolumeGroup operation from operation stack if it has no jobs.
This commit is contained in:
parent
ca0def38f7
commit
ee49c05d60
|
@ -31,6 +31,7 @@
|
||||||
#include "ops/setpartflagsoperation.h"
|
#include "ops/setpartflagsoperation.h"
|
||||||
#include "ops/setfilesystemlabeloperation.h"
|
#include "ops/setfilesystemlabeloperation.h"
|
||||||
#include "ops/createpartitiontableoperation.h"
|
#include "ops/createpartitiontableoperation.h"
|
||||||
|
#include "ops/resizevolumegroupoperation.h"
|
||||||
#include "ops/checkoperation.h"
|
#include "ops/checkoperation.h"
|
||||||
|
|
||||||
#include "jobs/setfilesystemlabeljob.h"
|
#include "jobs/setfilesystemlabeljob.h"
|
||||||
|
@ -395,6 +396,19 @@ bool OperationStack::mergeCreatePartitionTableOperation(Operation*& currentOp, O
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OperationStack::mergeResizeVolumeGroupResizeOperation(Operation*& pushedOp)
|
||||||
|
{
|
||||||
|
ResizeVolumeGroupOperation* pushedResizeVolumeGroupOp = dynamic_cast<ResizeVolumeGroupOperation*>(pushedOp);
|
||||||
|
|
||||||
|
if (pushedResizeVolumeGroupOp && pushedResizeVolumeGroupOp->jobs().count() == 0) {
|
||||||
|
Log() << xi18nc("@info:status", "Resizing Volume Group, nothing to do.");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** Pushes a new Operation on the OperationStack.
|
/** Pushes a new Operation on the OperationStack.
|
||||||
|
|
||||||
This method will call all methods that try to merge the new Operation with the
|
This method will call all methods that try to merge the new Operation with the
|
||||||
|
@ -408,6 +422,9 @@ void OperationStack::push(Operation* o)
|
||||||
{
|
{
|
||||||
Q_ASSERT(o);
|
Q_ASSERT(o);
|
||||||
|
|
||||||
|
if (mergeResizeVolumeGroupResizeOperation(o))
|
||||||
|
return;
|
||||||
|
|
||||||
for (auto currentOp = operations().rbegin(); currentOp != operations().rend(); ++currentOp) {
|
for (auto currentOp = operations().rbegin(); currentOp != operations().rend(); ++currentOp) {
|
||||||
if (mergeNewOperation(*currentOp, o))
|
if (mergeNewOperation(*currentOp, o))
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -98,6 +98,7 @@ protected:
|
||||||
bool mergePartFlagsOperation(Operation*& currentOp, Operation*& pushedOp);
|
bool mergePartFlagsOperation(Operation*& currentOp, Operation*& pushedOp);
|
||||||
bool mergePartLabelOperation(Operation*& currentOp, Operation*& pushedOp);
|
bool mergePartLabelOperation(Operation*& currentOp, Operation*& pushedOp);
|
||||||
bool mergeCreatePartitionTableOperation(Operation*& currentOp, Operation*& pushedOp);
|
bool mergeCreatePartitionTableOperation(Operation*& currentOp, Operation*& pushedOp);
|
||||||
|
bool mergeResizeVolumeGroupResizeOperation(Operation*& pushedOp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Operations m_Operations;
|
Operations m_Operations;
|
||||||
|
|
Loading…
Reference in New Issue