]> sourceware.org Git - lvm2.git/commitdiff
lvmdbusd: Add properties to LvCommon
authorTony Asleson <tasleson@redhat.com>
Wed, 5 Oct 2016 18:59:38 +0000 (13:59 -0500)
committerTony Asleson <tasleson@redhat.com>
Wed, 5 Oct 2016 18:59:38 +0000 (13:59 -0500)
The following LvCommon properties were added so that the API
would have the same functionality as lvm2app has.

LvCommon.MetaDataSizeBytes
LvCommon.Attr
LvCommon.MetaDataPercent
LvCommon.CopyPercent
LvCommon.SnapPercent
LvCommon.SyncPercent

daemons/lvmdbusd/cmdhandler.py
daemons/lvmdbusd/lv.py

index 3cb2cbd99cc5be32341d712369f658295c27482f..a5fbad2e3e99e9de70e270b20f27f46964395fa9 100644 (file)
@@ -485,7 +485,9 @@ def lvm_full_report_json():
                                'vg_name', 'pool_lv_uuid', 'pool_lv', 'origin_uuid',
                                'origin', 'data_percent',
                                'lv_attr', 'lv_tags', 'vg_uuid', 'lv_active', 'data_lv',
-                               'metadata_lv', 'lv_parent', 'lv_role', 'lv_layout']
+                               'metadata_lv', 'lv_parent', 'lv_role', 'lv_layout',
+                               'snap_percent', 'metadata_percent', 'copy_percent',
+                               'sync_percent', 'lv_metadata_size']
 
        lv_seg_columns = ['seg_pe_ranges', 'segtype', 'lv_uuid']
 
@@ -735,7 +737,9 @@ def lv_retrieve_with_segments():
                                'origin', 'data_percent',
                                'lv_attr', 'lv_tags', 'vg_uuid', 'lv_active', 'data_lv',
                                'metadata_lv', 'seg_pe_ranges', 'segtype', 'lv_parent',
-                               'lv_role', 'lv_layout']
+                               'lv_role', 'lv_layout',
+                           'snap_percent', 'metadata_percent', 'copy_percent',
+                           'sync_percent', 'lv_metadata_size']
 
        cmd = _dc('lvs', ['-a', '-o', ','.join(columns)])
        rc, out, err = call(cmd)
index 2a8a3fbc1e38c4e39a459da4205395ee7ecd1dd3..24c901c50d4657584b986c406f29f64e66f75bd4 100644 (file)
@@ -81,7 +81,12 @@ def lvs_state_retrieve(selection, cache_refresh=True):
                        n32(l['data_percent']), l['lv_attr'],
                        l['lv_tags'], l['lv_active'], l['data_lv'],
                        l['metadata_lv'], l['segtype'], l['lv_role'],
-                       l['lv_layout']))
+                       l['lv_layout'],
+                       n32(l['snap_percent']),
+                       n32(l['metadata_percent']),
+                       n32(l['copy_percent']),
+                       n32(l['sync_percent']),
+                       n(l['lv_metadata_size'])))
        return rc
 
 
@@ -138,7 +143,8 @@ class LvState(State):
        def __init__(self, Uuid, Name, Path, SizeBytes,
                        vg_name, vg_uuid, pool_lv_uuid, PoolLv,
                        origin_uuid, OriginLv, DataPercent, Attr, Tags, active,
-                       data_lv, metadata_lv, segtypes, role, layout):
+                       data_lv, metadata_lv, segtypes, role, layout, SnapPercent,
+                       MetaDataPercent, CopyPercent, SyncPercent, MetaDataSizeBytes):
                utils.init_class_from_arguments(self)
 
                # The segtypes is possibly an array with potentially dupes or a single
@@ -214,13 +220,19 @@ class LvState(State):
 @utils.dbus_property(LV_COMMON_INTERFACE, 'Name', 's')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'Path', 's')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'SizeBytes', 't')
-@utils.dbus_property(LV_COMMON_INTERFACE, 'DataPercent', 'u')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'SegType', 'as')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'Vg', 'o')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'OriginLv', 'o')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'PoolLv', 'o')
 @utils.dbus_property(LV_COMMON_INTERFACE, 'Devices', "a(oa(tts))")
 @utils.dbus_property(LV_COMMON_INTERFACE, 'HiddenLvs', "ao")
+@utils.dbus_property(LV_COMMON_INTERFACE, 'Attr', 's')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'DataPercent', 'u')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'SnapPercent', 'u')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'MetaDataPercent', 'u')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'CopyPercent', 'u')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'SyncPercent', 'u')
+@utils.dbus_property(LV_COMMON_INTERFACE, 'MetaDataSizeBytes', 't')
 class LvCommon(AutomatedProperties):
        _Tags_meta = ("as", LV_COMMON_INTERFACE)
        _Roles_meta = ("as", LV_COMMON_INTERFACE)
This page took 0.044274 seconds and 5 git commands to generate.