Re: [PATCH v2] virtmanager: Fixed the legacy firmware installation error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 12, 2021 at 05:38:48PM +0800, Yu-Chen, Cho wrote:
> From: "Cho, Yu-Chen" <acho@xxxxxxxx>
> 
> When we choose /usr/share/qemu/bios.bin or /usr/share/qemu/bios-256k.bin
> in Customize configuration before install, show this error message:
> 
> Unable to complete install: 'operation failed: unable to find any master var store for loader: /usr/share/qemu/bios.bin'
> 
> Traceback (most recent call last):
>   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
>     callback(asyncjob, *args, **kwargs)
>   File "/usr/share/virt-manager/virtManager/createvm.py", line 2081, in _do_async_install
>     installer.start_install(guest, meter=meter)
>   File "/usr/share/virt-manager/virtinst/install/installer.py", line 721, in start_install
>     domain = self._create_guest(
>   File "/usr/share/virt-manager/virtinst/install/installer.py", line 669, in _create_guest
>     domain = self.conn.createXML(install_xml or final_xml, 0)
>   File "/usr/lib64/python3.8/site-packages/libvirt.py", line 4347, in createXML
>     raise libvirtError('virDomainCreateXML() failed')
> libvirt.libvirtError: operation failed: unable to find any master var store for loader: /usr/share/qemu/bios.bin
> 
> This patch check the loader if it is include bios.bin and bios-256k.bin.
> 
> Signed-off-by: Yu-Chen, Cho <acho@xxxxxxxx>
> --
> v2:
> Fixed tabs vs spaces issues.
> 
> v1:
> Check the loader if it is include bios.bin and bios-256k.bin.
> ---
>  virtManager/object/domain.py | 18 +++++++++---------
>  virtinst/guest.py            | 13 +++++++++++++
>  2 files changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
> index cc2f506d..2fafe2b4 100644
> --- a/virtManager/object/domain.py
> +++ b/virtManager/object/domain.py
> @@ -671,16 +671,16 @@ class vmmDomain(vmmLibvirtObject):
>  
>          if loader != _SENTINEL:
>              if loader is None:
> -                # Implies seabios, aka the default, so clear everything
> -                guest.os.loader = None
> -                guest.os.loader_ro = None
> -                guest.os.loader_type = None
> -                guest.os.nvram = None
> -                guest.os.nvram_template = None
> +                # Implies the default, so clear everything
> +                guest.set_legacy_path(None)
>              else:
> -                # Implies UEFI
> -                guest.set_uefi_path(loader)
> -                guest.disable_hyperv_for_uefi()
> +                if ("bios.bin" or "bios-256k.bin" in loader):
> +                    # Implies Custom: seabios, not UEFI
> +                    guest.set_legacy_path(loader)
> +                else:
> +                    # Implies UEFI
> +                    guest.set_uefi_path(loader)
> +                    guest.disable_hyperv_for_uefi()

This if/else condition is going to be wrong for all non-x86
architectures.

I wonder if the UI shuld have a "firmware is UEFI" checkbox
instead.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux