1 From 572afb06f66f83ca95efa1b9386fceeaa1c9e11b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
3 Date: Fri, 6 Sep 2024 15:51:35 -0400
4 Subject: [PATCH] incusd/instance/qemu: Set O_DIRECT when passing in FDs
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This is required in most cases with QEMU 9.1.0.
11 Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
13 internal/server/instance/drivers/driver_qemu.go | 2 ++
14 1 file changed, 2 insertions(+)
16 diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go
17 index 37da21f42f..e25aab0667 100644
18 --- a/internal/server/instance/drivers/driver_qemu.go
19 +++ b/internal/server/instance/drivers/driver_qemu.go
20 @@ -4277,6 +4277,8 @@ func (d *qemu) addDriveConfig(qemuDev map[string]string, bootIndexes map[string]
21 permissions = unix.O_RDONLY
24 + permissions |= unix.O_DIRECT
26 f, err := os.OpenFile(driveConf.DevPath, permissions, 0)
28 return fmt.Errorf("Failed opening file descriptor for disk device %q: %w", driveConf.DevName, err)