Skip to content

Commit 07baf74

Browse files
authored
Merge pull request #2240 from stgraber/main
incusd/instance/qemu: Fix memory calculation logic
2 parents a082b02 + 60c8f08 commit 07baf74

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

internal/server/instance/drivers/driver_qemu.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,11 +4183,8 @@ func (d *qemu) addCPUMemoryConfig(conf *[]cfg.Section, cpuType string, cpuInfo *
41834183
}
41844184
}
41854185

4186-
if cpuType == "host" && lowestPhysBits > 0 {
4187-
// Line up cpuPhysBits with the lowest physical CPU value.
4188-
cpuPhysBits = lowestPhysBits
4189-
} else if lowestPhysBits < cpuPhysBits {
4190-
// Reduce curPhysBits below the default of 39 if a physical CPU uses a lower value.
4186+
// If a physical address size was detected, either align it with the VM (CPU passthrough) or use it as an upper bound.
4187+
if lowestPhysBits > 0 && (cpuType == "host" || lowestPhysBits < cpuPhysBits) {
41914188
cpuPhysBits = lowestPhysBits
41924189
}
41934190

0 commit comments

Comments
 (0)