FuguVM

App::FuguVM::Arch(3p) Perl Library Manual App::FuguVM::Arch(3p)

App::FuguVM::Arch - the architecture table of the supported guests

    use App::FuguVM::Arch;
    my $arch = App::FuguVM::Arch->new('amd64')
        or die "unknown architecture\n";
    my @cmd = ($arch->qemu_binary, '-M', $arch->machine);
    my $accel = $arch->accelerator($^O, $host_machine, $kvm);

The module holds the architecture table and nothing else. Each entry maps one OpenBSD architecture name, "amd64" or "arm64", to the QEMU binary, the machine type, the TCG CPU model, the host machine names, and the firmware paths. The QEMU spellings, "x86_64" and "aarch64", stay inside the table.

The module uses core Perl only, and it loads no other module of the distribution.

    App::FuguVM::Arch->new($name)

Return the architecture object for "amd64" or "arm64". Return "undef" for every other name. The comparison is case sensitive, so "AMD64" is an unknown value.

    App::FuguVM::Arch->names

Return the supported names, sorted. A diagnostic names them, so the message and the table cannot disagree.

"name" is the OpenBSD name of the architecture. "qemu_binary" is the QEMU binary name. "machine" is the "-M" machine string. "tcg_cpu" is the "-cpu" model for software emulation.

"firmware_paths" is the ordered list of absolute firmware code paths. "firmware_glob" is one glob pattern for the versioned Homebrew paths.

Return the variable-store template beside a firmware code file. Return "undef" when the architecture boots the code file with "-bios" alone. The x86 code files are split flash images, and "-bios" cannot load them. Each amd64 code file therefore pairs with the template in its directory, and both boot as pflash devices.

    $arch->accelerator($os, $host_machine, $kvm)

Return "kvm", "hvf" or "tcg" for one host. QEMU cannot accelerate a guest whose instruction set is not the host's, so a host machine of an other architecture always gives "tcg". The caller gives $^O, the uname machine, and whether /dev/kvm is writable. The method calls no syscall, so a test proves every branch on any host.

App::FuguVM::Config, App::FuguVM::Guest, fuguvm(1)

Dick Olsson <hi@senzilla.io>

2026-10-16 OpenBSD