From 33eaf69d5fb53ef54d2b9bfb5bf9b3e94f50bfc4 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 30 May 2024 19:08:57 +0200 Subject: [PATCH] virtcontainers: Drop QEMU's `Daemonize` knob QEMU isn't started as daemon anymore and this won't change (see #5736 for details). Drop the related code. Signed-off-by: Greg Kurz --- src/runtime/virtcontainers/qemu.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index 0d48d48b8d..7a189bb910 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -569,7 +569,6 @@ func (q *qemu) CreateVM(ctx context.Context, id string, network Network, hypervi NoDefaults: true, NoGraphic: true, NoReboot: true, - Daemonize: false, MemPrealloc: q.config.MemPrealloc, HugePages: q.config.HugePages, IOMMUPlatform: q.config.IOMMUPlatform, @@ -1105,16 +1104,10 @@ func (q *qemu) StartVM(ctx context.Context, timeout int) error { q.Logger().WithError(err).Error("failed to launch qemu") return fmt.Errorf("failed to launch qemu: %s", err) } - if q.qemuConfig.Knobs.Daemonize { - // LaunchQemu returns a handle on the upper QEMU process. - // Wait for it to exit to assume that the QEMU daemon was - // actually started. - qemuCmd.Wait() - } else { - // Log QEMU errors and ensure the QEMU process is reaped after - // termination. - go q.LogAndWait(qemuCmd, reader) - } + + // Log QEMU errors and ensure the QEMU process is reaped after + // termination. + go q.LogAndWait(qemuCmd, reader) err = q.waitVM(ctx, qmpConn, timeout) if err != nil {