From b64db848921a25832ef785ecc618370dd3d9bf09 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: May 15 2024 09:07:54 +0000 Subject: Version 256~rc2 - Various small changes all over - A fix for rhbz#2273069 --- diff --git a/0001-Revert-machined-add-varlink-interface-for-registerin.patch b/0001-Revert-machined-add-varlink-interface-for-registerin.patch index 7d833af..01946d6 100644 --- a/0001-Revert-machined-add-varlink-interface-for-registerin.patch +++ b/0001-Revert-machined-add-varlink-interface-for-registerin.patch @@ -1,4 +1,4 @@ -From a915f0937e7cf8cc7968a4cfb4a8880480a657a6 Mon Sep 17 00:00:00 2001 +From c93a24119977a11791aab0f3df5e5cb9973a34de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 11 May 2024 13:27:12 +0200 Subject: [PATCH] Revert "machined: add varlink interface for registering @@ -6,20 +6,16 @@ Subject: [PATCH] Revert "machined: add varlink interface for registering This reverts commit 5b44c81ff868a4d1b78a74e4770f7a8b2f1d0f91. --- - man/systemd-machined.service.xml | 6 +- - src/machine/machine-varlink.c | 171 ------------------------ - src/machine/machine-varlink.h | 6 - - src/machine/machined-varlink.c | 62 +-------- - src/machine/machined.c | 5 +- - src/machine/machined.h | 3 +- - src/machine/meson.build | 1 - - src/shared/meson.build | 1 - - src/shared/varlink-io.systemd.Machine.c | 22 --- - src/shared/varlink-io.systemd.Machine.h | 6 - - 10 files changed, 8 insertions(+), 275 deletions(-) - delete mode 100644 src/machine/machine-varlink.c + man/systemd-machined.service.xml | 6 +-- + src/machine/machine-varlink.h | 6 --- + src/machine/machined-varlink.c | 62 ++----------------------- + src/machine/machined.c | 5 +- + src/machine/machined.h | 3 +- + src/machine/meson.build | 1 - + src/shared/meson.build | 1 - + src/shared/varlink-io.systemd.Machine.h | 6 --- + 8 files changed, 8 insertions(+), 82 deletions(-) delete mode 100644 src/machine/machine-varlink.h - delete mode 100644 src/shared/varlink-io.systemd.Machine.c delete mode 100644 src/shared/varlink-io.systemd.Machine.h diff --git a/man/systemd-machined.service.xml b/man/systemd-machined.service.xml @@ -41,183 +37,6 @@ index b2899ff0fd..f3d7755973 100644 For more information please consult sd-login3 and -diff --git a/src/machine/machine-varlink.c b/src/machine/machine-varlink.c -deleted file mode 100644 -index 377b3d3f0e..0000000000 ---- a/src/machine/machine-varlink.c -+++ /dev/null -@@ -1,171 +0,0 @@ --/* SPDX-License-Identifier: LGPL-2.1-or-later */ -- --#include -- --#include "sd-id128.h" -- --#include "hostname-util.h" --#include "json.h" --#include "machine-varlink.h" --#include "machine.h" --#include "path-util.h" --#include "pidref.h" --#include "process-util.h" --#include "socket-util.h" --#include "string-util.h" --#include "varlink.h" -- --static JSON_DISPATCH_ENUM_DEFINE(dispatch_machine_class, MachineClass, machine_class_from_string); -- --static int machine_name(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { -- char **m = ASSERT_PTR(userdata); -- const char *hostname; -- int r; -- -- assert(variant); -- -- if (!json_variant_is_string(variant)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a string.", strna(name)); -- -- hostname = json_variant_string(variant); -- if (!hostname_is_valid(hostname, /* flags= */ 0)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Invalid machine name"); -- -- r = free_and_strdup(m, hostname); -- if (r < 0) -- return json_log_oom(variant, flags); -- -- return 0; --} -- --static int machine_leader(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { -- PidRef *leader = ASSERT_PTR(userdata); -- _cleanup_(pidref_done) PidRef temp = PIDREF_NULL; -- uint64_t k; -- int r; -- -- if (!json_variant_is_unsigned(variant)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not an integer.", strna(name)); -- -- k = json_variant_unsigned(variant); -- if (k > PID_T_MAX || !pid_is_valid(k)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a valid PID.", strna(name)); -- -- if (k == 1) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a valid leader PID.", strna(name)); -- -- r = pidref_set_pid(&temp, k); -- if (r < 0) -- return json_log(variant, flags, r, "Failed to pin process " PID_FMT ": %m", leader->pid); -- -- pidref_done(leader); -- -- *leader = TAKE_PIDREF(temp); -- -- return 0; --} -- --static int machine_ifindices(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { -- Machine *m = ASSERT_PTR(userdata); -- _cleanup_free_ int *netif = NULL; -- size_t n_netif, k = 0; -- -- assert(variant); -- -- if (!json_variant_is_array(variant)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not an array.", strna(name)); -- -- n_netif = json_variant_elements(variant); -- -- netif = new(int, n_netif); -- if (!netif) -- return json_log_oom(variant, flags); -- -- JsonVariant *i; -- JSON_VARIANT_ARRAY_FOREACH(i, variant) { -- uint64_t b; -- -- if (!json_variant_is_unsigned(i)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is not an unsigned integer.", k, strna(name)); -- -- b = json_variant_unsigned(i); -- if (b > INT_MAX || b <= 0) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Invalid network interface index %"PRIu64, b); -- -- netif[k++] = (int) b; -- } -- assert(k == n_netif); -- -- free_and_replace(m->netif, netif); -- m->n_netif = n_netif; -- -- return 0; --} -- --static int machine_cid(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) { -- unsigned cid, *c = ASSERT_PTR(userdata); -- -- assert(variant); -- -- if (!json_variant_is_unsigned(variant)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a string.", strna(name)); -- -- cid = json_variant_unsigned(variant); -- if (!VSOCK_CID_IS_REGULAR(cid)) -- return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a regular VSOCK CID.", strna(name)); -- -- *c = cid; -- -- return 0; --} -- --int vl_method_register(Varlink *link, JsonVariant *parameters, VarlinkMethodFlags flags, void *userdata) { -- Manager *manager = ASSERT_PTR(userdata); -- _cleanup_(machine_freep) Machine *machine = NULL; -- int r; -- -- static const JsonDispatch dispatch_table[] = { -- { "name", JSON_VARIANT_STRING, machine_name, offsetof(Machine, name), JSON_MANDATORY }, -- { "id", JSON_VARIANT_STRING, json_dispatch_id128, offsetof(Machine, id), 0 }, -- { "service", JSON_VARIANT_STRING, json_dispatch_string, offsetof(Machine, service), 0 }, -- { "class", JSON_VARIANT_STRING, dispatch_machine_class, offsetof(Machine, class), JSON_MANDATORY }, -- { "leader", JSON_VARIANT_UNSIGNED, machine_leader, offsetof(Machine, leader), 0 }, -- { "rootDirectory", JSON_VARIANT_STRING, json_dispatch_absolute_path, offsetof(Machine, root_directory), 0 }, -- { "ifIndices", JSON_VARIANT_ARRAY, machine_ifindices, 0, 0 }, -- { "vsockCid", JSON_VARIANT_UNSIGNED, machine_cid, offsetof(Machine, vsock_cid), 0 }, -- { "sshAddress", JSON_VARIANT_STRING, json_dispatch_string, offsetof(Machine, ssh_address), JSON_SAFE }, -- { "sshPrivateKeyPath", JSON_VARIANT_STRING, json_dispatch_absolute_path, offsetof(Machine, ssh_private_key_path), 0 }, -- {} -- }; -- -- r = machine_new(_MACHINE_CLASS_INVALID, NULL, &machine); -- if (r < 0) -- return r; -- -- r = varlink_dispatch(link, parameters, dispatch_table, machine); -- if (r != 0) -- return r; -- -- if (!pidref_is_set(&machine->leader)) { -- r = varlink_get_peer_pidref(link, &machine->leader); -- if (r < 0) -- return r; -- } -- -- r = machine_link(manager, machine); -- if (r < 0) -- return r; -- -- r = cg_pidref_get_unit(&machine->leader, &machine->unit); -- if (r < 0) -- return r; -- -- r = machine_start(machine, NULL, NULL); -- if (r < 0) -- return r; -- -- /* the manager will free this machine */ -- TAKE_PTR(machine); -- -- return varlink_reply(link, NULL); --} diff --git a/src/machine/machine-varlink.h b/src/machine/machine-varlink.h deleted file mode 100644 index ce4ec54dc1..0000000000 @@ -384,34 +203,6 @@ index d01367a159..17313aefed 100644 'varlink-io.systemd.ManagedOOM.c', 'varlink-io.systemd.MountFileSystem.c', 'varlink-io.systemd.NamespaceResource.c', -diff --git a/src/shared/varlink-io.systemd.Machine.c b/src/shared/varlink-io.systemd.Machine.c -deleted file mode 100644 -index 936f01f366..0000000000 ---- a/src/shared/varlink-io.systemd.Machine.c -+++ /dev/null -@@ -1,22 +0,0 @@ --/* SPDX-License-Identifier: LGPL-2.1-or-later */ -- --#include "varlink-idl.h" --#include "varlink-io.systemd.Machine.h" -- --static VARLINK_DEFINE_METHOD( -- Register, -- VARLINK_DEFINE_INPUT(name, VARLINK_STRING, 0), -- VARLINK_DEFINE_INPUT(id, VARLINK_STRING, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(service, VARLINK_STRING, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(class, VARLINK_STRING, 0), -- VARLINK_DEFINE_INPUT(leader, VARLINK_INT, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(rootDirectory, VARLINK_STRING, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(ifIndices, VARLINK_INT, VARLINK_ARRAY|VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(vsockCid, VARLINK_INT, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(sshAddress, VARLINK_STRING, VARLINK_NULLABLE), -- VARLINK_DEFINE_INPUT(sshPrivateKeyPath, VARLINK_STRING, VARLINK_NULLABLE)); -- --VARLINK_DEFINE_INTERFACE( -- io_systemd_Machine, -- "io.systemd.Machine", -- &vl_method_Register); diff --git a/src/shared/varlink-io.systemd.Machine.h b/src/shared/varlink-io.systemd.Machine.h deleted file mode 100644 index c9fc85f150..0000000000 diff --git a/systemd.spec b/systemd.spec index 6a7d82d..e9c2281 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,4 +1,4 @@ -%global commit 1781de18ab8ebc3e42a607851d8effb3b0355c87 +#global commit 1781de18ab8ebc3e42a607851d8effb3b0355c87 %{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})} # We ship a .pc file but don't want to have a dep on pkg-config. We @@ -32,13 +32,13 @@ # Build from git main %bcond upstream 0 -%{!?release_override:%global release_override 2} +%{!?release_override:%global release_override 1} Name: systemd Url: https://systemd.io # Allow users to specify the version and release when building the rpm by # setting the %%version_override and %%release_override macros. -Version: %{?version_override}%{!?version_override:256~rc1^20240509git%{shortcommit}} +Version: %{?version_override}%{!?version_override:256~rc2} Release: %{?release_override:%{release_override}%{?dist}}%{!?release_override:%autorelease} %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?) @@ -110,7 +110,7 @@ Patch0001: 0001-Revert-machined-add-varlink-interface-for-registerin.patch # Work-around for dracut issue: run generators directly when we are in initrd # https://bugzilla.redhat.com/show_bug.cgi?id=2164404 # Drop when dracut-060 is available. -Patch0001: https://github.com/systemd/systemd/pull/26494.patch +Patch0002: https://github.com/systemd/systemd/pull/26494.patch %endif # Those are downstream-only patches, but we don't want them in packit builds: