Delete partition table in LVM VG remove operation.
This commit is contained in:
parent
d6c375f959
commit
5c2d485b32
|
@ -47,16 +47,13 @@ QString DeactivateVolumeGroupOperation::description() const
|
||||||
|
|
||||||
void DeactivateVolumeGroupOperation::preview()
|
void DeactivateVolumeGroupOperation::preview()
|
||||||
{
|
{
|
||||||
|
m_PartitionTable = device().partitionTable();
|
||||||
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeactivateVolumeGroupOperation::undo()
|
void DeactivateVolumeGroupOperation::undo()
|
||||||
{
|
{
|
||||||
PartitionTable* tmp = device().partitionTable();
|
device().setPartitionTable(m_PartitionTable);
|
||||||
if (tmp != partitionTable()) {
|
|
||||||
device().setPartitionTable(partitionTable());
|
|
||||||
delete tmp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** loop through given device's partitions to check if any is mounted.
|
/** loop through given device's partitions to check if any is mounted.
|
||||||
|
|
|
@ -73,10 +73,6 @@ protected:
|
||||||
return m_Device;
|
return m_Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionTable* partitionTable() {
|
|
||||||
return m_PartitionTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
||||||
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "ops/removevolumegroupoperation.h"
|
#include "ops/removevolumegroupoperation.h"
|
||||||
#include "jobs/removevolumegroupjob.h"
|
#include "jobs/removevolumegroupjob.h"
|
||||||
|
|
||||||
|
#include "core/partitiontable.h"
|
||||||
#include "core/volumemanagerdevice.h"
|
#include "core/volumemanagerdevice.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -41,8 +42,11 @@ QString RemoveVolumeGroupOperation::description() const
|
||||||
|
|
||||||
void RemoveVolumeGroupOperation::preview()
|
void RemoveVolumeGroupOperation::preview()
|
||||||
{
|
{
|
||||||
|
m_PartitionTable = device().partitionTable();
|
||||||
|
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveVolumeGroupOperation::undo()
|
void RemoveVolumeGroupOperation::undo()
|
||||||
{
|
{
|
||||||
|
device().setPartitionTable(m_PartitionTable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
class PartitionTable;
|
||||||
class RemoveVolumeGroupJob;
|
class RemoveVolumeGroupJob;
|
||||||
class VolumeManagerDevice;
|
class VolumeManagerDevice;
|
||||||
class OperationStack;
|
class OperationStack;
|
||||||
|
@ -67,6 +68,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
RemoveVolumeGroupJob* m_RemoveVolumeGroupJob;
|
RemoveVolumeGroupJob* m_RemoveVolumeGroupJob;
|
||||||
VolumeManagerDevice& m_Device;
|
VolumeManagerDevice& m_Device;
|
||||||
|
PartitionTable* m_PartitionTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue