diff options
author | Ivan Kruglov <mail@ikruglov.com> | 2024-10-21 13:53:38 +0200 |
---|---|---|
committer | Ivan Kruglov <mail@ikruglov.com> | 2024-11-01 15:30:34 +0100 |
commit | 38a0cf4172f472b24b2001e11412251664de33bb (patch) | |
tree | b3893204da337a453743eca04c93be3af6d4cae5 /src/shared | |
parent | machine: use report_errno_and_exit() in dbus code (diff) | |
download | systemd-38a0cf4172f472b24b2001e11412251664de33bb.tar.xz systemd-38a0cf4172f472b24b2001e11412251664de33bb.zip |
machine: introduce io.systemd.MachineImage.Clone method
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/varlink-io.systemd.MachineImage.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/shared/varlink-io.systemd.MachineImage.c b/src/shared/varlink-io.systemd.MachineImage.c index 5d3b3fd32f..68ea5cf279 100644 --- a/src/shared/varlink-io.systemd.MachineImage.c +++ b/src/shared/varlink-io.systemd.MachineImage.c @@ -53,6 +53,11 @@ 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)); +#define VARLINK_DEFINE_IMAGE_LOOKUP_AND_POLKIT_FIELDS \ + SD_VARLINK_FIELD_COMMENT("The name of an image"), \ + SD_VARLINK_DEFINE_INPUT(name, SD_VARLINK_STRING, 0), \ + VARLINK_DEFINE_POLKIT_INPUT + static SD_VARLINK_DEFINE_METHOD( Update, SD_VARLINK_FIELD_COMMENT("The name of a image to update."), @@ -65,7 +70,16 @@ static SD_VARLINK_DEFINE_METHOD( SD_VARLINK_DEFINE_INPUT(limit, SD_VARLINK_INT, SD_VARLINK_NULLABLE), VARLINK_DEFINE_POLKIT_INPUT); +static SD_VARLINK_DEFINE_METHOD( + Clone, + VARLINK_DEFINE_IMAGE_LOOKUP_AND_POLKIT_FIELDS, + SD_VARLINK_FIELD_COMMENT("The new name of the image"), + SD_VARLINK_DEFINE_INPUT(newName, SD_VARLINK_STRING, 0), + 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)); + static SD_VARLINK_DEFINE_ERROR(NoSuchImage); +static SD_VARLINK_DEFINE_ERROR(TooManyOperations); SD_VARLINK_DEFINE_INTERFACE( io_systemd_MachineImage, @@ -76,5 +90,9 @@ SD_VARLINK_DEFINE_INTERFACE( &vl_method_List, SD_VARLINK_SYMBOL_COMMENT("Update image allowing to rename or toggle read-only flag"), &vl_method_Update, + SD_VARLINK_SYMBOL_COMMENT("Clone image"), + &vl_method_Clone, SD_VARLINK_SYMBOL_COMMENT("No matching image exists"), - &vl_error_NoSuchImage); + &vl_error_NoSuchImage, + SD_VARLINK_SYMBOL_COMMENT("Too many ongoing background operations"), + &vl_error_TooManyOperations); |