From 07b6454dea8f4b97508ed5fced354fea21660a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 21 Dec 2023 13:57:05 -0500 Subject: [PATCH] lxd/instances/qemu: Don't fail event sending on missing agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber (cherry picked from commit 2fbdbe9518f8739d5e4adcca0e9e963e96f41053) Signed-off-by: Mark Bolton License: Apache-2.0 --- lxd/instance/drivers/driver_qemu.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go index 8214422e9efa..23ae9e638b10 100644 --- a/lxd/instance/drivers/driver_qemu.go +++ b/lxd/instance/drivers/driver_qemu.go @@ -8498,6 +8498,11 @@ func (d *qemu) devlxdEventSend(eventType string, eventMessage map[string]any) er client, err := d.getAgentClient() if err != nil { + // Don't fail if the VM simply doesn't have an agent. + if err == errQemuAgentOffline { + return nil + } + return err }