summaryrefslogtreecommitdiffstats
path: root/src/shared/varlink-io.systemd.MachineImage.c
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2024-10-08 17:00:11 +0200
committerIvan Kruglov <mail@ikruglov.com>2024-10-14 11:09:18 +0200
commit7809bd3ba78bd9c7b8a5272ca16edc1e8082c1ac (patch)
treec3091fa6d1f5d86264df4f8c86ea90943e375330 /src/shared/varlink-io.systemd.MachineImage.c
parentmachine: introduce io.systemd.MachineImage.List varlink method (diff)
downloadsystemd-7809bd3ba78bd9c7b8a5272ca16edc1e8082c1ac.tar.xz
systemd-7809bd3ba78bd9c7b8a5272ca16edc1e8082c1ac.zip
machine: introduce io.systemd.MachineImage.Update varlink method
io.systemd.MachineImage.Update implements the following dbus org.freedesktop.machine1.Manager interfaces: - RenameImage - MarkImageReadOnly - SetImageLimit
Diffstat (limited to 'src/shared/varlink-io.systemd.MachineImage.c')
-rw-r--r--src/shared/varlink-io.systemd.MachineImage.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/varlink-io.systemd.MachineImage.c b/src/shared/varlink-io.systemd.MachineImage.c
index e79b34063e..514c5720c6 100644
--- a/src/shared/varlink-io.systemd.MachineImage.c
+++ b/src/shared/varlink-io.systemd.MachineImage.c
@@ -43,6 +43,18 @@ static SD_VARLINK_DEFINE_METHOD_FULL(
SD_VARLINK_FIELD_COMMENT("OS release information of an image. It contains an array of key value pairs read from the os-release(5) file in the image."),
SD_VARLINK_DEFINE_OUTPUT(OSRelease, SD_VARLINK_STRING, SD_VARLINK_NULLABLE|SD_VARLINK_ARRAY));
+static SD_VARLINK_DEFINE_METHOD(
+ Update,
+ SD_VARLINK_FIELD_COMMENT("The name of a image to update."),
+ SD_VARLINK_DEFINE_INPUT(name, SD_VARLINK_STRING, 0),
+ SD_VARLINK_FIELD_COMMENT("If non-null the new name of the image"),
+ SD_VARLINK_DEFINE_INPUT(newName, SD_VARLINK_STRING, SD_VARLINK_NULLABLE),
+ SD_VARLINK_FIELD_COMMENT("If non-null value of the read-only flag of the image"),
+ SD_VARLINK_DEFINE_INPUT(readOnly, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE),
+ SD_VARLINK_FIELD_COMMENT("If non-null value of image quota limit"),
+ SD_VARLINK_DEFINE_INPUT(limit, SD_VARLINK_INT, SD_VARLINK_NULLABLE),
+ VARLINK_DEFINE_POLKIT_INPUT);
+
static SD_VARLINK_DEFINE_ERROR(NoSuchImage);
SD_VARLINK_DEFINE_INTERFACE(
@@ -50,5 +62,7 @@ SD_VARLINK_DEFINE_INTERFACE(
"io.systemd.MachineImage",
SD_VARLINK_SYMBOL_COMMENT("List images"),
&vl_method_List,
+ SD_VARLINK_SYMBOL_COMMENT("Update image allowing to rename or toggle read-only flag"),
+ &vl_method_Update,
SD_VARLINK_SYMBOL_COMMENT("No matching image exists"),
&vl_error_NoSuchImage);