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) <brauner@kernel.org>
This commit is contained in:
Christian Brauner
2026-04-24 14:39:25 +02:00
parent 93c04d4aba
commit 67cd0977cd
5 changed files with 3 additions and 34 deletions
-1
View File
@@ -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',
+1 -1
View File
@@ -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),
@@ -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);
@@ -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;
+2 -9
View File
@@ -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");