[lxc-devel] [lxd/master] lxd/qemu: Don't do file lock on custom volumes

stgraber on Github lxc-bot at linuxcontainers.org
Fri Jul 3 02:25:14 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200702/54369fdb/attachment-0001.bin>
-------------- next part --------------
From 391e51e4335f56910f23c0d8e1681df15a31157a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 2 Jul 2020 22:24:41 -0400
Subject: [PATCH] lxd/qemu: Don't do file lock on custom volumes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/instance/drivers/driver_qemu.go           | 1 +
 lxd/instance/drivers/driver_qemu_templates.go | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index 7617db6da1..1645a8652a 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -2011,6 +2011,7 @@ func (vm *qemu) addDriveConfig(sb *strings.Builder, bootIndexes map[string]int,
 		"bootIndex": bootIndexes[driveConf.DevName],
 		"cacheMode": cacheMode,
 		"aioMode":   aioMode,
+		"shared":    driveConf.TargetPath != "/",
 	})
 }
 
diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go
index 5f066b7a01..ee7943ddd9 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -343,6 +343,9 @@ if = "none"
 cache = "{{.cacheMode}}"
 aio = "{{.aioMode}}"
 discard = "on"
+{{if .shared -}}
+file.locking = "off"
+{{- end }}
 
 [device "dev-lxd_{{.devName}}"]
 driver = "scsi-hd"


More information about the lxc-devel mailing list