Skip to content

Commit

Permalink
lxd/instance: Add support for armhf vm's on arm64 hosts
Browse files Browse the repository at this point in the history
Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
  • Loading branch information
kadinsayani committed Sep 10, 2024
1 parent 94110ee commit 0df5c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lxd/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ func (d *qemu) qemuArchConfig(arch int) (path string, bus string, err error) {
}

return path, "pcie", nil
} else if arch == osarch.ARCH_64BIT_ARMV8_LITTLE_ENDIAN {
} else if arch == osarch.ARCH_32BIT_ARMV7_LITTLE_ENDIAN || arch == osarch.ARCH_32BIT_ARMV8_LITTLE_ENDIAN || arch == osarch.ARCH_64BIT_ARMV8_LITTLE_ENDIAN {
path, err := exec.LookPath(basePath + "qemu-system-aarch64")
if err != nil {
return "", "", err
Expand Down
4 changes: 4 additions & 0 deletions lxd/instance/drivers/driver_qemu_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func qemuMachineType(architecture int) string {
switch architecture {
case osarch.ARCH_64BIT_INTEL_X86:
machineType = "q35"
case osarch.ARCH_32BIT_ARMV7_LITTLE_ENDIAN:
machineType = "virt"
case osarch.ARCH_32BIT_ARMV8_LITTLE_ENDIAN:
machineType = "virt"
case osarch.ARCH_64BIT_ARMV8_LITTLE_ENDIAN:
machineType = "virt"
case osarch.ARCH_64BIT_POWERPC_LITTLE_ENDIAN:
Expand Down

0 comments on commit 0df5c94

Please sign in to comment.