Skip to content

Commit

Permalink
Added bios type firmware support for loongarch64
Browse files Browse the repository at this point in the history
Since the internal snapshot function of virt-manager
cannot be used when using UEFI firmware, the bios type
firmware is added to loongarch64. The bios type firmware
uses the QEMU_EFI.fd file and loads it with the -bios parameter.
This allows us to use virt-manager internal snapshots
while the virtual machine is on.

This also requires edk2 to have a corresponding json file in
/usr/share/qemu/firmware at installation time.
The file contents are as follows:

{
    "description": "LoongArch UEFI for loongarch64",
    "interface-types": [
        "bios"
    ],
    "mapping": {
        "device": "memory",
        "filename": "/usr/share/qemu/QEMU_CODE.fd"
    },
    "targets": [
        {
            "architecture": "loongarch64",
            "machines": [
                "virt*"
            ]
        }
    ],
    "features": [
        "acpi"
    ],
    "tags": [

    ]
}

Signed-off-by: Xianglai Li <[email protected]>
Signed-off-by: Xianglai Li <[email protected]>
  • Loading branch information
zhaotianrui-loongson authored and lixianglai committed Jun 17, 2024
1 parent 2eaa3aa commit d03e926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion virtManager/details/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,11 @@ def _buf_changed_cb(*args):
"installed on the host."))

# Put the default entry first in the list
model.append([domcaps.label_for_firmware_path(None), None, True, None])
if self.vm.get_arch() == "loongarch64":
model.append([domcaps.label_for_firmware_path(None), None, True, "bios"])
else:
model.append([domcaps.label_for_firmware_path(None), None, True, None])

for row in uefirows:
model.append(row)
combo.set_active(0)
Expand Down
2 changes: 1 addition & 1 deletion virtinst/domcapabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def label_for_firmware_path(self, path):
about it or not
"""
if not path:
if self.arch in ["i686", "x86_64"]:
if self.arch in ["i686", "x86_64", "loongarch64"]:
return _("BIOS")
return _("Default")

Expand Down

0 comments on commit d03e926

Please sign in to comment.