The CleanPool requires --more to be set and checks that in
`vl_method_clean_pool`. By switching to SD_VARLINK_REQUIRES_MORE
this will automatically be handled and is more clear to
the varlink users.
Based on the comment from Lennart in
https://github.com/systemd/systemd/pull/40650#discussion_r2832378002
and the work done by Mike in
09388a6b9e4 (thanks!).
assert(link);
assert(parameters);
+ assert(FLAGS_SET(flags, SD_VARLINK_METHOD_MORE));
if (manager->n_operations >= OPERATIONS_MAX)
return sd_varlink_error(link, "io.systemd.MachineImage.TooManyOperations", NULL);
if (r != 0)
return r;
- if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE))
- return sd_varlink_error(link, SD_VARLINK_ERROR_EXPECTED_MORE, NULL);
-
if (manager->runtime_scope != RUNTIME_SCOPE_USER) {
r = varlink_verify_polkit_async(
link,
static SD_VARLINK_DEFINE_METHOD_FULL(
CleanPool,
- SD_VARLINK_SUPPORTS_MORE,
+ SD_VARLINK_REQUIRES_MORE,
VARLINK_DEFINE_POLKIT_INPUT,
SD_VARLINK_FIELD_COMMENT("Allows removing all or only hidden images"),
SD_VARLINK_DEFINE_INPUT_BY_TYPE(mode, CleanPoolMode, 0),