]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: io.systemd.Repart.ListCandidateDevices requires 'more'
authorMike Yuan <me@yhndnzj.com>
Sun, 15 Feb 2026 02:08:12 +0000 (03:08 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 16 Feb 2026 08:44:55 +0000 (09:44 +0100)
src/repart/repart.c
src/shared/varlink-io.systemd.Repart.c

index ac6cccbcba259976a1d720c4c17a29e80973f186..3d1846b7e87772a5e8e7d86c12a7cc3d943426c1 100644 (file)
@@ -10324,14 +10324,12 @@ static int vl_method_list_candidate_devices(
         int r;
 
         assert(link);
+        assert(FLAGS_SET(flags, SD_VARLINK_METHOD_MORE));
 
         r = sd_varlink_dispatch(link, parameters, dispatch_table, &p);
         if (r != 0)
                 return r;
 
-        if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE))
-                return sd_varlink_error(link, SD_VARLINK_ERROR_EXPECTED_MORE, NULL);
-
         BlockDevice *l = NULL;
         size_t n = 0;
         CLEANUP_ARRAY(l, n, block_device_array_free);
index 35b860db9e27ef68c8aaa26a84f45ed95ec0ddbe..8d504545951179fcb8c8ed1ffe5e78702ebacb3b 100644 (file)
@@ -59,8 +59,9 @@ static SD_VARLINK_DEFINE_METHOD_FULL(
                 SD_VARLINK_FIELD_COMMENT("If used with the 'more' flag, a progress percentrage (specific to the work done for the specified phase+object is sent in progress updates."),
                 SD_VARLINK_DEFINE_OUTPUT(progress, SD_VARLINK_INT, SD_VARLINK_NULLABLE));
 
-static SD_VARLINK_DEFINE_METHOD(
+static SD_VARLINK_DEFINE_METHOD_FULL(
                 ListCandidateDevices,
+                SD_VARLINK_REQUIRES_MORE,
                 SD_VARLINK_FIELD_COMMENT("Control whether to include the root disk of the currently booted OS in the list. Defaults to false, i.e. the root disk is included."),
                 SD_VARLINK_DEFINE_INPUT(ignoreRoot, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE),
                 SD_VARLINK_FIELD_COMMENT("Control whether to include block devices with zero size in the list, i.e. typically block devices without any inserted medium. Defaults to false, i.e. empty block devices are included."),