From aad813bf170c7d901fcf1b664303e0204642ac61 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 11 Oct 2022 18:53:59 +0100 Subject: portable: rename flag PORTABLE_FORCE -> PORTABLE_FORCE_ATTACH The name is used only internally, also it was just added. Allows adding different types of force flags. --- src/portable/portable.c | 4 ++-- src/portable/portable.h | 4 ++-- src/portable/portablectl.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/portable') diff --git a/src/portable/portable.c b/src/portable/portable.c index 7172701ca2..79bda5cf0b 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -1357,7 +1357,7 @@ int portable_attach( if (r < 0) return r; - if (!FLAGS_SET(flags, PORTABLE_REATTACH) && !FLAGS_SET(flags, PORTABLE_FORCE)) + if (!FLAGS_SET(flags, PORTABLE_REATTACH) && !FLAGS_SET(flags, PORTABLE_FORCE_ATTACH)) HASHMAP_FOREACH(item, unit_files) { r = unit_file_exists(LOOKUP_SCOPE_SYSTEM, &paths, item->name); if (r < 0) @@ -1600,7 +1600,7 @@ int portable_detach( if (r == 0) continue; - if (!FLAGS_SET(flags, PORTABLE_REATTACH) && !FLAGS_SET(flags, PORTABLE_FORCE)) { + if (!FLAGS_SET(flags, PORTABLE_REATTACH) && !FLAGS_SET(flags, PORTABLE_FORCE_ATTACH)) { r = unit_file_is_active(bus, unit_name, error); if (r < 0) return r; diff --git a/src/portable/portable.h b/src/portable/portable.h index dc2f8781b7..30895b18f9 100644 --- a/src/portable/portable.h +++ b/src/portable/portable.h @@ -22,11 +22,11 @@ typedef struct PortableMetadata { typedef enum PortableFlags { PORTABLE_RUNTIME = 1 << 0, /* Public API via DBUS, do not change */ - PORTABLE_FORCE = 1 << 1, /* Public API via DBUS, do not change */ + PORTABLE_FORCE_ATTACH = 1 << 1, /* Public API via DBUS, do not change */ PORTABLE_PREFER_COPY = 1 << 2, PORTABLE_PREFER_SYMLINK = 1 << 3, PORTABLE_REATTACH = 1 << 4, - _PORTABLE_MASK_PUBLIC = PORTABLE_RUNTIME | PORTABLE_FORCE, + _PORTABLE_MASK_PUBLIC = PORTABLE_RUNTIME | PORTABLE_FORCE_ATTACH, _PORTABLE_TYPE_MAX, _PORTABLE_TYPE_INVALID = -EINVAL, } PortableFlags; diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 7e3627d1da..94a3970f87 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -869,7 +869,7 @@ static int attach_reattach_image(int argc, char *argv[], const char *method) { return bus_log_create_error(r); if (STR_IN_SET(method, "AttachImageWithExtensions", "ReattachImageWithExtensions")) { - uint64_t flags = (arg_runtime ? PORTABLE_RUNTIME : 0) | (arg_force ? PORTABLE_FORCE : 0); + uint64_t flags = (arg_runtime ? PORTABLE_RUNTIME : 0) | (arg_force ? PORTABLE_FORCE_ATTACH : 0); r = sd_bus_message_append(m, "st", arg_copy_mode, flags); } else @@ -941,7 +941,7 @@ static int detach_image(int argc, char *argv[], void *userdata) { if (strv_isempty(arg_extension_images)) r = sd_bus_message_append(m, "b", arg_runtime); else { - uint64_t flags = (arg_runtime ? PORTABLE_RUNTIME : 0) | (arg_force ? PORTABLE_FORCE : 0); + uint64_t flags = (arg_runtime ? PORTABLE_RUNTIME : 0) | (arg_force ? PORTABLE_FORCE_ATTACH : 0); r = sd_bus_message_append(m, "t", flags); } -- cgit v1.2.1