Skip to content

Commit c37e82c

Browse files
committed
lvm: Fix getting VDO saving percent from LVM DBus API
The SavingPercent property is a double so we can't directly save it to our (integer) struct.
1 parent 6c05da1 commit c37e82c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/lvm/lvm-dbus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,7 @@ static BDLVMVDOPooldata* get_vdo_data_from_props (GVariant *props, GError **erro
14051405
BDLVMVDOPooldata *data = g_new0 (BDLVMVDOPooldata, 1);
14061406
GVariantDict dict;
14071407
gchar *value = NULL;
1408+
gdouble percent = 0;
14081409

14091410
g_variant_dict_init (&dict, props);
14101411

@@ -1469,7 +1470,8 @@ static BDLVMVDOPooldata* get_vdo_data_from_props (GVariant *props, GError **erro
14691470
value = NULL;
14701471

14711472
g_variant_dict_lookup (&dict, "UsedSize", "t", &(data->used_size));
1472-
g_variant_dict_lookup (&dict, "SavingPercent", "d", &(data->saving_percent));
1473+
g_variant_dict_lookup (&dict, "SavingPercent", "d", &percent);
1474+
data->saving_percent = (int) percent;
14731475

14741476
g_variant_dict_lookup (&dict, "IndexMemorySize", "t", &(data->index_memory_size));
14751477

0 commit comments

Comments
 (0)