commit: be31025842e3924d94ce4886ce9486eb0e31c5f6
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 2 06:09:12 2025 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Jul 2 06:10:37 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be310258
app-containers/incus: add qemu fix for 6.14
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
...us-6.14-fix-qemu-memory-calculation-logic.patch | 35 ++++++++++++++++++++++
.../{incus-6.14.ebuild => incus-6.14-r1.ebuild} | 2 ++
2 files changed, 37 insertions(+)
diff --git
a/app-containers/incus/files/incus-6.14-fix-qemu-memory-calculation-logic.patch
b/app-containers/incus/files/incus-6.14-fix-qemu-memory-calculation-logic.patch
new file mode 100644
index 000000000000..dea5b2dc1473
--- /dev/null
+++
b/app-containers/incus/files/incus-6.14-fix-qemu-memory-calculation-logic.patch
@@ -0,0 +1,35 @@
+From 60c8f084a7cb9e38b5003fc056538f6631609cb8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
+Date: Tue, 1 Jul 2025 21:24:04 -0400
+Subject: [PATCH] incusd/instance/qemu: Fix memory calculation logic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes another issue with the logic where a system with no detected
+physical bits would cause a 0 value which would then be decreased,
+leading to the maximum value possible of 1TB.
+
+Signed-off-by: Stéphane Graber <[email protected]>
+---
+ internal/server/instance/drivers/driver_qemu.go | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/internal/server/instance/drivers/driver_qemu.go
b/internal/server/instance/drivers/driver_qemu.go
+index 995d1d31ed5..2897226d930 100644
+--- a/internal/server/instance/drivers/driver_qemu.go
++++ b/internal/server/instance/drivers/driver_qemu.go
+@@ -4183,11 +4183,8 @@ func (d *qemu) addCPUMemoryConfig(conf *[]cfg.Section,
cpuType string, cpuInfo *
+ }
+ }
+
+- if cpuType == "host" && lowestPhysBits > 0 {
+- // Line up cpuPhysBits with the lowest physical CPU
value.
+- cpuPhysBits = lowestPhysBits
+- } else if lowestPhysBits < cpuPhysBits {
+- // Reduce curPhysBits below the default of 39 if a
physical CPU uses a lower value.
++ // If a physical address size was detected, either align it
with the VM (CPU passthrough) or use it as an upper bound.
++ if lowestPhysBits > 0 && (cpuType == "host" || lowestPhysBits <
cpuPhysBits) {
+ cpuPhysBits = lowestPhysBits
+ }
+
diff --git a/app-containers/incus/incus-6.14.ebuild
b/app-containers/incus/incus-6.14-r1.ebuild
similarity index 98%
rename from app-containers/incus/incus-6.14.ebuild
rename to app-containers/incus/incus-6.14-r1.ebuild
index e9a35ca7d8bd..2058289f5d62 100644
--- a/app-containers/incus/incus-6.14.ebuild
+++ b/app-containers/incus/incus-6.14-r1.ebuild
@@ -94,6 +94,8 @@ RESTRICT="test"
GOPATH="${S}/_dist"
+PATCHES=( "${FILESDIR}"/incus-6.14-fix-qemu-memory-calculation-logic.patch )
+
src_unpack() {
verify-sig_src_unpack
go-module_src_unpack