Skip to content

Commit

Permalink
Merge pull request #1009 from vojtechtrefny/master_fix-dbus-pvresize
Browse files Browse the repository at this point in the history
lvm-dbus: Fix passing size for pvresize over DBus
  • Loading branch information
vojtechtrefny authored Mar 26, 2024
2 parents 8aafe98 + 7afe642 commit 737e4c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/lvm-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ gboolean bd_lvm_pvresize (const gchar *device, guint64 size, const BDExtraArg **
if (!obj_path)
return FALSE;

params = g_variant_new ("(u)", size);
params = g_variant_new ("(t)", size);
return call_lvm_method_sync (obj_path, PV_INTF, "ReSize", params, NULL, extra, TRUE, error);
}

Expand Down
6 changes: 6 additions & 0 deletions tests/lvm_dbus_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,15 @@ def test_pvresize(self):
succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**2, None)
self.assertTrue(succ)

info = BlockDev.lvm_pvinfo(self.loop_dev)
self.assertEqual(info.pv_size, 200 * 1024**2)

succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**3, None)
self.assertTrue(succ)

info = BlockDev.lvm_pvinfo(self.loop_dev)
self.assertEqual(info.pv_size, 200 * 1024**3)

@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
class LvmTestPVscan(LvmPVonlyTestCase):
def test_pvscan(self):
Expand Down
6 changes: 6 additions & 0 deletions tests/lvm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,15 @@ def test_pvresize(self):
succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**2, None)
self.assertTrue(succ)

info = BlockDev.lvm_pvinfo(self.loop_dev)
self.assertEqual(info.pv_size, 200 * 1024**2)

succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**3, None)
self.assertTrue(succ)

info = BlockDev.lvm_pvinfo(self.loop_dev)
self.assertEqual(info.pv_size, 200 * 1024**3)

class LvmTestPVscan(LvmPVonlyTestCase):
def test_pvscan(self):
"""Verify that pvscan runs without issues with cache or without"""
Expand Down

0 comments on commit 737e4c6

Please sign in to comment.