summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2025-01-09 16:02:19 +0100
committerIvan Kruglov <mail@ikruglov.com>2025-01-15 11:47:58 +0100
commit8342390161ff35cf5a6cb25cb50311b9dbfa687f (patch)
treef6fd1c4d8fe3282bb56b89fb90234652afd97a12 /src/shared
parentmachine: use image_set_pool_limit() in dbus (diff)
downloadsystemd-8342390161ff35cf5a6cb25cb50311b9dbfa687f.tar.xz
systemd-8342390161ff35cf5a6cb25cb50311b9dbfa687f.zip
machine: introduce io.systemd.MachineImage.SetPoolLimit
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/varlink-io.systemd.MachineImage.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/shared/varlink-io.systemd.MachineImage.c b/src/shared/varlink-io.systemd.MachineImage.c
index 813b6c8e68..8e9d90fe70 100644
--- a/src/shared/varlink-io.systemd.MachineImage.c
+++ b/src/shared/varlink-io.systemd.MachineImage.c
@@ -80,8 +80,15 @@ static SD_VARLINK_DEFINE_METHOD(
Remove,
VARLINK_DEFINE_IMAGE_LOOKUP_AND_POLKIT_FIELDS);
+static SD_VARLINK_DEFINE_METHOD(
+ SetPoolLimit,
+ VARLINK_DEFINE_POLKIT_INPUT,
+ SD_VARLINK_FIELD_COMMENT("New image quota limit"),
+ SD_VARLINK_DEFINE_INPUT(limit, SD_VARLINK_INT, 0));
+
static SD_VARLINK_DEFINE_ERROR(NoSuchImage);
static SD_VARLINK_DEFINE_ERROR(TooManyOperations);
+static SD_VARLINK_DEFINE_ERROR(NotSupported);
SD_VARLINK_DEFINE_INTERFACE(
io_systemd_MachineImage,
@@ -90,13 +97,17 @@ SD_VARLINK_DEFINE_INTERFACE(
&vl_type_AcquireMetadata,
SD_VARLINK_SYMBOL_COMMENT("List images"),
&vl_method_List,
- SD_VARLINK_SYMBOL_COMMENT("Update image allowing to rename or toggle read-only flag"),
+ SD_VARLINK_SYMBOL_COMMENT("Update image allowing to rename, toggle read-only flag, or set a limit"),
&vl_method_Update,
SD_VARLINK_SYMBOL_COMMENT("Clone image"),
&vl_method_Clone,
SD_VARLINK_SYMBOL_COMMENT("Remove image"),
&vl_method_Remove,
+ SD_VARLINK_SYMBOL_COMMENT("Sets an overall quota limit on the pool of images"),
+ &vl_method_SetPoolLimit,
SD_VARLINK_SYMBOL_COMMENT("No matching image exists"),
&vl_error_NoSuchImage,
SD_VARLINK_SYMBOL_COMMENT("Too many ongoing background operations"),
- &vl_error_TooManyOperations);
+ &vl_error_TooManyOperations,
+ SD_VARLINK_SYMBOL_COMMENT("Requested operation is not supported"),
+ &vl_error_NotSupported);