varlink: add enum types for class and whom fields in io.systemd.Machine

Convert the class field (Register input, List output) from plain string
to MachineClass enum type, and the whom field (Kill input) to KillWhom
enum type.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ivan Kruglov
2026-04-14 02:10:52 -07:00
parent 2fda0fb4c7
commit 5d0ac2c23c
6 changed files with 46 additions and 14 deletions
+4
View File
@@ -503,6 +503,10 @@ executables += [
core_test_template + {
'sources' : files('test-varlink-idl-manager.c'),
},
test_template + {
'sources' : files('test-varlink-idl-machine.c'),
'objects' : ['systemd-machined'],
},
test_template + {
'sources' : files('test-watchdog.c'),
'type' : 'unsafe',
+13
View File
@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "machine.h"
#include "tests.h"
#include "test-varlink-idl-util.h"
#include "varlink-io.systemd.Machine.h"
TEST(machine_enums_idl) {
TEST_IDL_ENUM(MachineClass, machine_class, vl_type_MachineClass);
TEST_IDL_ENUM(KillWhom, kill_whom, vl_type_KillWhom);
}
DEFINE_TEST_MAIN(LOG_DEBUG);