mirror of
https://github.com/systemd/systemd.git
synced 2025-02-27 01:57:35 +03:00
machine: add MachineImage interface
Follow-up for fb0ea6a6a36b5fa97e6c57d608bb9f7acb63c8b2. Fixes #34772.
This commit is contained in:
parent
d115bd5ab4
commit
7a3ee9217e
src
test/units
@ -15,6 +15,7 @@
|
|||||||
#include "socket-util.h"
|
#include "socket-util.h"
|
||||||
#include "user-util.h"
|
#include "user-util.h"
|
||||||
#include "varlink-io.systemd.Machine.h"
|
#include "varlink-io.systemd.Machine.h"
|
||||||
|
#include "varlink-io.systemd.MachineImage.h"
|
||||||
#include "varlink-io.systemd.UserDatabase.h"
|
#include "varlink-io.systemd.UserDatabase.h"
|
||||||
|
|
||||||
typedef struct LookupParameters {
|
typedef struct LookupParameters {
|
||||||
@ -687,9 +688,12 @@ static int manager_varlink_init_machine(Manager *m) {
|
|||||||
|
|
||||||
sd_varlink_server_set_userdata(s, m);
|
sd_varlink_server_set_userdata(s, m);
|
||||||
|
|
||||||
r = sd_varlink_server_add_interface(s, &vl_interface_io_systemd_Machine);
|
r = sd_varlink_server_add_interface_many(
|
||||||
|
s,
|
||||||
|
&vl_interface_io_systemd_Machine,
|
||||||
|
&vl_interface_io_systemd_MachineImage);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to add Machine interface to varlink server: %m");
|
return log_error_errno(r, "Failed to add Machine and MachineImage interfaces to varlink server: %m");
|
||||||
|
|
||||||
r = sd_varlink_server_bind_method_many(
|
r = sd_varlink_server_bind_method_many(
|
||||||
s,
|
s,
|
||||||
|
@ -184,6 +184,7 @@ shared_sources = files(
|
|||||||
'varlink-io.systemd.Import.c',
|
'varlink-io.systemd.Import.c',
|
||||||
'varlink-io.systemd.Journal.c',
|
'varlink-io.systemd.Journal.c',
|
||||||
'varlink-io.systemd.Machine.c',
|
'varlink-io.systemd.Machine.c',
|
||||||
|
'varlink-io.systemd.MachineImage.c',
|
||||||
'varlink-io.systemd.ManagedOOM.c',
|
'varlink-io.systemd.ManagedOOM.c',
|
||||||
'varlink-io.systemd.MountFileSystem.c',
|
'varlink-io.systemd.MountFileSystem.c',
|
||||||
'varlink-io.systemd.NamespaceResource.c',
|
'varlink-io.systemd.NamespaceResource.c',
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "sd-varlink-idl.h"
|
#include "sd-varlink-idl.h"
|
||||||
|
|
||||||
|
#include "bus-polkit.h"
|
||||||
#include "varlink-io.systemd.MachineImage.h"
|
#include "varlink-io.systemd.MachineImage.h"
|
||||||
|
|
||||||
static SD_VARLINK_DEFINE_METHOD_FULL(
|
static SD_VARLINK_DEFINE_METHOD_FULL(
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "varlink-io.systemd.Import.h"
|
#include "varlink-io.systemd.Import.h"
|
||||||
#include "varlink-io.systemd.Journal.h"
|
#include "varlink-io.systemd.Journal.h"
|
||||||
#include "varlink-io.systemd.Machine.h"
|
#include "varlink-io.systemd.Machine.h"
|
||||||
|
#include "varlink-io.systemd.MachineImage.h"
|
||||||
#include "varlink-io.systemd.ManagedOOM.h"
|
#include "varlink-io.systemd.ManagedOOM.h"
|
||||||
#include "varlink-io.systemd.MountFileSystem.h"
|
#include "varlink-io.systemd.MountFileSystem.h"
|
||||||
#include "varlink-io.systemd.NamespaceResource.h"
|
#include "varlink-io.systemd.NamespaceResource.h"
|
||||||
@ -190,6 +191,8 @@ TEST(parse_format) {
|
|||||||
print_separator();
|
print_separator();
|
||||||
test_parse_format_one(&vl_interface_io_systemd_Machine);
|
test_parse_format_one(&vl_interface_io_systemd_Machine);
|
||||||
print_separator();
|
print_separator();
|
||||||
|
test_parse_format_one(&vl_interface_io_systemd_MachineImage);
|
||||||
|
print_separator();
|
||||||
test_parse_format_one(&vl_interface_xyz_test);
|
test_parse_format_one(&vl_interface_xyz_test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,6 +256,11 @@ done
|
|||||||
|
|
||||||
long_running_machine_start
|
long_running_machine_start
|
||||||
|
|
||||||
|
varlinkctl introspect /run/systemd/machine/io.systemd.Machine io.systemd.Machine
|
||||||
|
varlinkctl introspect /run/systemd/machine/io.systemd.Machine io.systemd.MachineImage
|
||||||
|
varlinkctl introspect /run/systemd/machine/io.systemd.MachineImage io.systemd.Machine
|
||||||
|
varlinkctl introspect /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage
|
||||||
|
|
||||||
# test io.systemd.Machine.List
|
# test io.systemd.Machine.List
|
||||||
varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{}' | grep 'long-running'
|
varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{}' | grep 'long-running'
|
||||||
varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{}' | grep '.host'
|
varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{}' | grep '.host'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user