Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvm-dbus: Fix passing size for pvresize over DBus #1009

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading