Skip to content

Conversation

@vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Jan 22, 2026

The SavingPercent property is a double so we can't directly save it to our (integer) struct.

Summary by CodeRabbit

  • Bug Fixes
    • Improved data type handling in storage system information retrieval, ensuring accurate conversion and display of storage metrics.

✏️ Tip: You can customize this high-level summary in your review settings.

The SavingPercent property is a double so we can't directly save
it to our (integer) struct.
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Modifies get_vdo_data_from_props function to read SavingPercent as a double from a DBus dictionary before casting to integer, replacing a direct assignment with an intermediate type conversion step.

Changes

Cohort / File(s) Summary
Type Conversion Fix
src/plugins/lvm/lvm-dbus.c
Introduces temporary double variable percent to read SavingPercent dictionary value as double ("d") type before casting and assigning to data->saving_percent integer field, enabling proper type conversion during DBus property extraction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'lvm: Fix getting VDO saving percent from LVM DBus API' accurately describes the main change: fixing a type mismatch issue when reading the VDO SavingPercent property from the LVM D-Bus API, which is the core purpose of this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@tbzatek tbzatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants