ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / in / incus / 0c37b7e3ec65b4d0e166e2127d9f1835320165b8.patch
blobd4f9cfccc21a1d564b925c245859dd55aed1221d
1 From 0c37b7e3ec65b4d0e166e2127d9f1835320165b8 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 17:07:11 -0400
4 Subject: [PATCH] incusd/instance/qemu: Make O_DIRECT conditional on
5 directCache
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
11 ---
12 internal/server/instance/drivers/driver_qemu.go | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
15 diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go
16 index 5a94c9db43..9609b73c1b 100644
17 --- a/internal/server/instance/drivers/driver_qemu.go
18 +++ b/internal/server/instance/drivers/driver_qemu.go
19 @@ -4276,7 +4276,9 @@ func (d *qemu) addDriveConfig(qemuDev map[string]string, bootIndexes map[string]
20 permissions = unix.O_RDONLY
23 - permissions |= unix.O_DIRECT
24 + if directCache {
25 + permissions |= unix.O_DIRECT
26 + }
28 f, err := os.OpenFile(driveConf.DevPath, permissions, 0)
29 if err != nil {