The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7641

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From ded25b35e89968ca7f92bcf2b13b46b44ca6d1bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 9 Jul 2020 23:03:22 -0400
Subject: [PATCH] lxd/qemu: Fix unbound hugepages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/instance/drivers/driver_qemu_templates.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lxd/instance/drivers/driver_qemu_templates.go 
b/lxd/instance/drivers/driver_qemu_templates.go
index 41006e9892..f4789ae3c2 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -228,6 +228,7 @@ threads = "{{.cpuThreads}}"
 {{if eq .architecture "x86_64" -}}
 {{$memory := .memory -}}
 {{$hugepages := .hugepages -}}
+{{if .cpuNumaHostNodes -}}
 {{range $index, $element := .cpuNumaHostNodes}}
 [object "mem{{$index}}"]
 {{if ne $hugepages "" -}}
@@ -242,6 +243,18 @@ size = "{{$memory}}M"
 host-nodes = "{{$element}}"
 policy = "bind"
 {{end}}
+{{else}}
+[object "mem0"]
+{{if ne $hugepages "" -}}
+qom-type = "memory-backend-file"
+mem-path = "{{$hugepages}}"
+prealloc = "on"
+discard-data = "on"
+{{- else}}
+qom-type = "memory-backend-ram"
+{{- end }}
+size = "{{$memory}}M"
+{{end}}
 
 {{range $index, $element := .cpuNumaNodes}}
 [numa]
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to