[partition] Fix minimum size parsing in partition layout
When a partition doesn't have a minimum size in the partition layout configuration, it defaults to using 100% of the available space. This patch fixes this error by setting the minimum partition size to 0 when the attribute has been omitted. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
a31cbefab6
commit
18bb71aceb
@ -103,6 +103,9 @@ PartitionLayout::addEntry( QString mountPoint, QString size, QString min )
|
|||||||
entry.partMountPoint = mountPoint;
|
entry.partMountPoint = mountPoint;
|
||||||
entry.partFileSystem = FileSystem::Ext4;
|
entry.partFileSystem = FileSystem::Ext4;
|
||||||
entry.partSize = parseSizeString( size , &entry.partSizeUnit );
|
entry.partSize = parseSizeString( size , &entry.partSizeUnit );
|
||||||
|
if (min.isEmpty())
|
||||||
|
entry.partMinSize = 0;
|
||||||
|
else
|
||||||
entry.partMinSize = parseSizeString( min , &entry.partMinSizeUnit );
|
entry.partMinSize = parseSizeString( min , &entry.partMinSizeUnit );
|
||||||
|
|
||||||
partLayout.append( entry );
|
partLayout.append( entry );
|
||||||
@ -117,6 +120,9 @@ PartitionLayout::addEntry( QString label, QString mountPoint, QString fs, QStrin
|
|||||||
entry.partMountPoint = mountPoint;
|
entry.partMountPoint = mountPoint;
|
||||||
entry.partFileSystem = FileSystem::typeForName( fs );
|
entry.partFileSystem = FileSystem::typeForName( fs );
|
||||||
entry.partSize = parseSizeString( size , &entry.partSizeUnit );
|
entry.partSize = parseSizeString( size , &entry.partSizeUnit );
|
||||||
|
if (min.isEmpty())
|
||||||
|
entry.partMinSize = 0;
|
||||||
|
else
|
||||||
entry.partMinSize = parseSizeString( min , &entry.partMinSizeUnit );
|
entry.partMinSize = parseSizeString( min , &entry.partMinSizeUnit );
|
||||||
|
|
||||||
partLayout.append( entry );
|
partLayout.append( entry );
|
||||||
|
Loading…
Reference in New Issue
Block a user