From: Christian Brauner Date: Thu, 23 Apr 2026 08:22:17 +0000 (+0200) Subject: vmspawn-varlink: drop AcquireQMP stub and QemuMachineInstance interface X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F41763%2Fhead;p=thirdparty%2Fsystemd.git vmspawn-varlink: drop AcquireQMP stub and QemuMachineInstance interface The AcquireQMP() method was a placeholder that always returned EOPNOTSUPP, reserving room for a future id-rewriting QMP multiplex proxy. The broader direction is for systemd-vmspawn to remain the single source of truth for VM control rather than exposing raw QMP to clients. Since AcquireQMP was the only method on io.systemd.QemuMachineInstance (and AlreadyAcquired was its only error), remove the whole interface along with the stub, and update the controlAddress field comment in io.systemd.Machine to stop referencing it. Signed-off-by: Christian Brauner (Amutable) --- diff --git a/src/shared/meson.build b/src/shared/meson.build index 56b823c50cd..a94b78ba94a 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -238,7 +238,6 @@ shared_sources = files( 'varlink-io.systemd.Network.Link.c', 'varlink-io.systemd.PCRExtend.c', 'varlink-io.systemd.PCRLock.c', - 'varlink-io.systemd.QemuMachineInstance.c', 'varlink-io.systemd.Repart.c', 'varlink-io.systemd.Resolve.c', 'varlink-io.systemd.Resolve.Hook.c', diff --git a/src/shared/varlink-io.systemd.Machine.c b/src/shared/varlink-io.systemd.Machine.c index da373a3c207..cb1b0665d60 100644 --- a/src/shared/varlink-io.systemd.Machine.c +++ b/src/shared/varlink-io.systemd.Machine.c @@ -57,7 +57,7 @@ static SD_VARLINK_DEFINE_METHOD( SD_VARLINK_DEFINE_INPUT(vSockCid, SD_VARLINK_INT, SD_VARLINK_NULLABLE), SD_VARLINK_DEFINE_INPUT(sshAddress, SD_VARLINK_STRING, SD_VARLINK_NULLABLE), SD_VARLINK_DEFINE_INPUT(sshPrivateKeyPath, SD_VARLINK_STRING, SD_VARLINK_NULLABLE), - SD_VARLINK_FIELD_COMMENT("Varlink socket address for direct machine control. The server at this address is expected to implement io.systemd.MachineInstance and optionally io.systemd.VirtualMachineInstance and io.systemd.QemuMachineInstance."), + SD_VARLINK_FIELD_COMMENT("Varlink socket address for direct machine control. The server at this address is expected to implement io.systemd.MachineInstance and optionally io.systemd.VirtualMachineInstance."), SD_VARLINK_DEFINE_INPUT(controlAddress, SD_VARLINK_STRING, SD_VARLINK_NULLABLE), SD_VARLINK_FIELD_COMMENT("Controls whether to allocate a scope unit for the machine to register. If false, the client already took care of that and registered a service/scope specific to the machine."), SD_VARLINK_DEFINE_INPUT(allocateUnit, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE), diff --git a/src/shared/varlink-io.systemd.QemuMachineInstance.c b/src/shared/varlink-io.systemd.QemuMachineInstance.c deleted file mode 100644 index b03fa2199c4..00000000000 --- a/src/shared/varlink-io.systemd.QemuMachineInstance.c +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ - -#include "varlink-io.systemd.QemuMachineInstance.h" - -static SD_VARLINK_DEFINE_METHOD_FULL( - AcquireQMP, - SD_VARLINK_REQUIRES_UPGRADE); - -static SD_VARLINK_DEFINE_ERROR(AlreadyAcquired); - -SD_VARLINK_DEFINE_INTERFACE( - io_systemd_QemuMachineInstance, - "io.systemd.QemuMachineInstance", - SD_VARLINK_SYMBOL_COMMENT("Acquire a direct QMP connection to the QEMU instance via protocol upgrade"), - &vl_method_AcquireQMP, - SD_VARLINK_SYMBOL_COMMENT("A QMP connection has already been acquired by another client"), - &vl_error_AlreadyAcquired); diff --git a/src/shared/varlink-io.systemd.QemuMachineInstance.h b/src/shared/varlink-io.systemd.QemuMachineInstance.h deleted file mode 100644 index 203dacb40c4..00000000000 --- a/src/shared/varlink-io.systemd.QemuMachineInstance.h +++ /dev/null @@ -1,6 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -#pragma once - -#include "sd-varlink-idl.h" - -extern const sd_varlink_interface vl_interface_io_systemd_QemuMachineInstance; diff --git a/src/vmspawn/vmspawn-varlink.c b/src/vmspawn/vmspawn-varlink.c index 2e0daa6039f..51a1091e40a 100644 --- a/src/vmspawn/vmspawn-varlink.c +++ b/src/vmspawn/vmspawn-varlink.c @@ -9,7 +9,6 @@ #include "string-util.h" #include "strv.h" #include "varlink-io.systemd.MachineInstance.h" -#include "varlink-io.systemd.QemuMachineInstance.h" #include "varlink-io.systemd.VirtualMachineInstance.h" #include "varlink-util.h" #include "vmspawn-qmp.h" @@ -184,10 +183,6 @@ static int vl_method_subscribe_events(sd_varlink *link, sd_json_variant *paramet return 0; } -static int vl_method_acquire_qmp(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) { - return sd_varlink_error_errno(link, -EOPNOTSUPP); -} - static void vl_disconnect(sd_varlink_server *server, sd_varlink *link, void *userdata) { VmspawnVarlinkContext *ctx = ASSERT_PTR(userdata); @@ -372,8 +367,7 @@ int vmspawn_varlink_setup( r = sd_varlink_server_add_interface_many( ctx->varlink_server, &vl_interface_io_systemd_MachineInstance, - &vl_interface_io_systemd_VirtualMachineInstance, - &vl_interface_io_systemd_QemuMachineInstance); + &vl_interface_io_systemd_VirtualMachineInstance); if (r < 0) return log_error_errno(r, "Failed to add varlink interfaces: %m"); @@ -385,8 +379,7 @@ int vmspawn_varlink_setup( "io.systemd.MachineInstance.Resume", vl_method_resume, "io.systemd.MachineInstance.Reboot", vl_method_reboot, "io.systemd.MachineInstance.Describe", vl_method_describe, - "io.systemd.MachineInstance.SubscribeEvents", vl_method_subscribe_events, - "io.systemd.QemuMachineInstance.AcquireQMP", vl_method_acquire_qmp); + "io.systemd.MachineInstance.SubscribeEvents", vl_method_subscribe_events); if (r < 0) return log_error_errno(r, "Failed to bind varlink methods: %m");