From 2801ec637d70c1fcd0532f791ee6faead2d18ab2 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 25 Mar 2026 13:04:26 +0100 Subject: [PATCH 1/3] swap: Fix duplicate enum value for BDSwapTechMode BD_SWAP_TECH_MODE_SET_UUID had the same value (1 << 3) as BD_SWAP_TECH_MODE_SET_LABEL making it impossible to distinguish between label and UUID capability checks. Co-Authored-By: Claude Opus 4.6 --- src/lib/plugin_apis/swap.api | 2 +- src/plugins/swap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/plugin_apis/swap.api b/src/lib/plugin_apis/swap.api index 52eaa9444..c7e824907 100644 --- a/src/lib/plugin_apis/swap.api +++ b/src/lib/plugin_apis/swap.api @@ -30,7 +30,7 @@ typedef enum { BD_SWAP_TECH_MODE_ACTIVATE_DEACTIVATE = 1 << 1, BD_SWAP_TECH_MODE_QUERY = 1 << 2, BD_SWAP_TECH_MODE_SET_LABEL = 1 << 3, - BD_SWAP_TECH_MODE_SET_UUID = 1 << 3, + BD_SWAP_TECH_MODE_SET_UUID = 1 << 4, } BDSwapTechMode; /** diff --git a/src/plugins/swap.h b/src/plugins/swap.h index f860c5c7f..28352370c 100644 --- a/src/plugins/swap.h +++ b/src/plugins/swap.h @@ -27,7 +27,7 @@ typedef enum { BD_SWAP_TECH_MODE_ACTIVATE_DEACTIVATE = 1 << 1, BD_SWAP_TECH_MODE_QUERY = 1 << 2, BD_SWAP_TECH_MODE_SET_LABEL = 1 << 3, - BD_SWAP_TECH_MODE_SET_UUID = 1 << 3, + BD_SWAP_TECH_MODE_SET_UUID = 1 << 4, } BDSwapTechMode; /* From e8fa1a5a42c00e618c38208044f2ef14ab188e85 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 25 Mar 2026 13:05:34 +0100 Subject: [PATCH 2/3] nvdimm: Fix region name filter in bd_nvdimm_list_namespaces The region filter was comparing bus_name against the region device name instead of region_name, so filtering by region never worked. Co-Authored-By: Claude Opus 4.6 --- src/plugins/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/nvdimm.c b/src/plugins/nvdimm.c index 095680bee..962d25362 100644 --- a/src/plugins/nvdimm.c +++ b/src/plugins/nvdimm.c @@ -556,7 +556,7 @@ BDNVDIMMNamespaceInfo** bd_nvdimm_list_namespaces (const gchar *bus_name, const continue; ndctl_region_foreach (bus, region) { - if (region_name && g_strcmp0 (bus_name, ndctl_region_get_devname (region)) != 0) + if (region_name && g_strcmp0 (region_name, ndctl_region_get_devname (region)) != 0) continue; ndctl_namespace_foreach (region, ndns) { From a4cdb58101ce2282c9be597b022ea7495b446b46 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 25 Mar 2026 13:13:24 +0100 Subject: [PATCH 3/3] tests: Fix wrong function call in PartSetUUIDCase The test for setting UUID on MSDOS partition table was calling part_set_part_name instead of part_set_part_uuid. The test passed because MSDOS doesn't support partition names either, but it wasn't actually testing UUID functionality. Co-Authored-By: Claude Opus 4.6 --- tests/part_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/part_test.py b/tests/part_test.py index ef99a13fa..821e8e7c9 100644 --- a/tests/part_test.py +++ b/tests/part_test.py @@ -1236,10 +1236,10 @@ def test_set_part_uuid(self): # we should still get proper data back self.assertTrue(ps) - self.assertIn(ps.uuid, ("", None)) # no name + self.assertIn(ps.uuid, ("", None)) # no uuid with self.assertRaises(GLib.GError): - BlockDev.part_set_part_name (self.loop_devs[0], ps.path, self.test_uuid) + BlockDev.part_set_part_uuid (self.loop_devs[0], ps.path, self.test_uuid) class PartSetTypeCase(PartTestCase):