Bug 2258946 - unknown firmware.json arch breaks all `virsh domcapabilities` calls
Summary: unknown firmware.json arch breaks all `virsh domcapabilities` calls
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 39
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-01-18 07:03 UTC by JianHong Yin
Modified: 2024-11-27 22:40 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-27 22:40:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
virt-install --debug (35.20 KB, text/plain)
2024-02-29 01:44 UTC, JianHong Yin
no flags Details

Description JianHong Yin 2024-01-18 07:03:11 UTC
create aarch64 get error message:
  ACPI need UEFI ...
but when I add --boot=uefi option get another error:
  libvirt version does not support  UEFI ...

It works fine before I updating system to latest(libvirt version come to 9.7)

Reproducible: Always

Steps to Reproduce:
1. virt-install  create  aarch64  VM
Actual Results:  
create aarch64 VM fail

Expected Results:  
create success

Comment 1 JianHong Yin 2024-01-19 03:56:16 UTC
I got it:
  /usr/share/qemu/firmware/54-edk2-loongarch64-raw.json  breaks the new libvirt->aarch64 creating 

but before update to latest libvirt-9.7, it works fine.
 so I guess that a regular expression matching modification somewhere caused this problem.


the contant of /usr/share/qemu/firmware/54-edk2-loongarch64-raw.json
'''
$ cat /usr/share/qemu/firmware/54-edk2-loongarch64-raw.json
{
    "description": "UEFI firmware for LOONGARCH64 virtual machines",
    "interface-types": [
        "uefi"
    ],
    "mapping": {
        "device": "flash",
        "mode" : "split",
        "executable": {
            "filename": "/usr/share/qemu/edk2-loongarch64-code.fd",
            "format": "raw"
        },
        "nvram-template": {
            "filename": "/usr/share/qemu/edk2-loongarch64-vars.fd",
            "format": "raw"
        }
    },
    "targets": [
        {
            "architecture": "loongarch64",
            "machines": [
                "virt",
                "virt-*"
            ]
        }
    ],
    "features": [

    ],
    "tags": [

    ]
}
'''

Comment 2 Cole Robinson 2024-02-28 17:02:55 UTC
@jiyin  thanks for the report. can you provide `rpm -qf /usr/share/qemu/firmware/54-edk2-loongarch64-raw.json` ? I'm wondering where that file comes from

do you still see this with latest libvirt and qemu and virt-install from virt-preview? https://copr.fedorainfracloud.org/coprs/g/virtmaint-sig/virt-preview/

If so, please also provide the full `virt-install --debug ...` output when reproducing

Comment 3 JianHong Yin 2024-02-29 01:22:27 UTC
(In reply to Cole Robinson from comment #2)
> @jiyin  thanks for the report. can you provide `rpm -qf
> /usr/share/qemu/firmware/54-edk2-loongarch64-raw.json` ? I'm wondering where
> that file comes from
it comes from a mail list thread that provides loongarch support.

> 
> do you still see this with latest libvirt and qemu and virt-install from
> virt-preview?

yes, still see this issue on latest fedora-39.

> https://copr.fedorainfracloud.org/coprs/g/virtmaint-sig/virt-preview/
> 
> If so, please also provide the full `virt-install --debug ...` output when
> reproducing

OK, will add attachment.

Comment 4 JianHong Yin 2024-02-29 01:44:01 UTC
Created attachment 2019362 [details]
virt-install --debug

Comment 5 Cole Robinson 2024-02-29 13:43:29 UTC
Ok the virt-install log explains it. `virsh domcapabilities` will fail if libvirt encounters any qemu firmware file with an unknown arch string. Seems like it shouldn't hard fail for that case.

@abologna probably your neck of the woods. Create a qemu-firmware descriptor like in Comment #1, and any domcapabilities run will fail:

$ sudo virsh domcapabilities
error: failed to get emulator capabilities
error: internal error: unknown architecture 'loongarch64'

Comment 6 Andrea Bolognani 2024-02-29 14:04:56 UTC
Yeah, that's clearly not right. I'll look into it.

Comment 8 Andrea Bolognani 2024-03-04 14:26:38 UTC
Fix pushed upstream.

  commit e4abb5f0fd9d5f5eb38046cacf64a5400596d26a
  Author: Andrea Bolognani <abologna>
  Date:   Thu Feb 29 15:43:45 2024 +0100

    qemu: Make firmware parsing failures non-fatal
    
    At the moment, any kind of issue being detected in any of the
    firmware descriptor files will result in the entire process
    being aborted.
    
    In particular, installing a build of edk2 for an architecture
    that libvirt doesn't yet know about, for example loongarch64,
    will break most firmware-related functionality: it will no
    longer be possible to define new EFI VMs, start existing ones,
    or even just obtain the domcapabilities for any architecture.
    
    This is obviously unnecessarily harsh. Adopt a more relaxed
    approach and simply ignore the firmware descriptors that we
    are unable to parse correctly.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2258946
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Michal Privoznik <mprivozn>

  v10.1.0-13-ge4abb5f0fd

Cole, up to you whether you want to backport this.

Comment 9 Aoife Moloney 2024-11-13 10:29:06 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '39'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 39 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 10 Aoife Moloney 2024-11-27 22:40:41 UTC
Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26.

Fedora Linux 39 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.