Skip to content

Commit

Permalink
Merge pull request #937 from vojtechtrefny/master_vdo-pool-lv-type
Browse files Browse the repository at this point in the history
Set LogicalVolume.Type to "vdopool" for LVM VDO pools
  • Loading branch information
vojtechtrefny committed Nov 29, 2021
2 parents f637bce + 8c0039e commit 9b39fe8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/lvm2/data/org.freedesktop.UDisks2.lvm2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,13 @@

<!-- Type:
The general type of a logical volume. One of "block" or
"pool". More types might be defined in the future.
The general type of a logical volume. One of "block", "pool"
or "vdopool". More types might be defined in the future.
A volume of type "block" can be used as a block device. A
volume of type "pool" can be used to create thin volumes.
A volume of type "vdopool" is the internal pool for the
VDO logical volume device.
-->
<property name="Type" type="s" access="read"/>

Expand Down
2 changes: 2 additions & 0 deletions modules/lvm2/udiskslinuxlogicalvolume.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ udisks_linux_logical_volume_update (UDisksLinuxLogicalVolume *logical_volume

if (target_type == 't' && volume_type == 't')
type = "pool";
else if (volume_type == 'd')
type = "vdopool";
if (meta_lv_info && meta_lv_info->size)
size += meta_lv_info->size;

Expand Down
3 changes: 3 additions & 0 deletions src/tests/dbus-tests/test_20_LVM.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ def test_create(self):
dbus_size = self.get_property(pool, '.LogicalVolume', 'Size')
dbus_size.assertEqual(psize)

dbus_type = self.get_property(lv, '.LogicalVolume', 'Type')
dbus_type.assertNotEqual('vdopool')

# VDO properties
dbus_comp = self.get_property(lv, '.VDOVolume', 'Compression')
dbus_comp.assertTrue()
Expand Down

0 comments on commit 9b39fe8

Please sign in to comment.