Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu: using incorrect datadir /usr/lib when build qemu package #23495

Closed
phrdina opened this issue Jul 9, 2020 · 9 comments · Fixed by #24884
Closed

qemu: using incorrect datadir /usr/lib when build qemu package #23495

phrdina opened this issue Jul 9, 2020 · 9 comments · Fixed by #24884

Comments

@phrdina
Copy link

phrdina commented Jul 9, 2020

System

  • xuname:
    Void 5.7.7_1 x86_64 x86_64 AuthenticAMD uptodate rF
  • package:
    qemu-5.0.0_2

Expected behavior

edk2 json firmware files installed by qemu package should be in /usr/share/qemu/firmware/ directory.

Actual behavior

They are currently installed in /usr/lib/qemu/firmware/ directory which is incorrect. If you check QEMU documentation for the firmware json files https://git.qemu.org/?p=qemu.git;a=blob;f=docs/interop/firmware.json;hb=HEAD it has an explicit list of directories where the firmware json files should be and libvirt looks for this files only at these directories in order to provide the installed firmwares to users or to management applications like virt-manager.

Steps to reproduce the behavior

xbps-install qemu
xbps-query -f qemu


sgn: fixed the qemu link

@sgn
Copy link
Member

sgn commented Jul 11, 2020

We installed that way because of pkglint-elf-in-usrshare hook.
See ec31c86 (qemu: install firmware files to /usr/lib to please the pkglint-elf-in-usrshare hook, 2019-01-27)

I don't know if symlink from /usr/lib to /usr/share works.
I usually use pure qemu without libvirtd.


It looks like only /usr/share/qemu/firmware needs to be symlink-ed/move-d

@phrdina
Copy link
Author

phrdina commented Jul 12, 2020

Symlink would work for libvirt but I'm not sure if it's correct for void linux distribution as I'm not familiar with it.

@pandom79
Copy link
Contributor

Symlink would work for libvirt but I'm not sure if it's correct for void linux distribution as I'm not familiar with it.

hi phrdina,
few days ago, you have answered at my email.
i built qemu as you suggested and now libvirt finds the firmware correctly.
Thare are two problems again:

  1. i had to patch makefile to resolve build error caused by pkglint-elf-in-usrshare. I think that it is wrong but i only wanted to do a test for libvirt, therefore , i'll try to create a symbolic link.
  2. The virt manager gui shows only firware uefi but it doesn't show uefi secure boot firmware again. I tried to set q35 machine type and storage format raw and disk bus sata. Now , the paths are right, why does it not show?
    regards

@phrdina
Copy link
Author

phrdina commented Jul 20, 2020

Hi @pandom79 so there is a bug in virt-manager GUI.

If you start creating new VM in the Step 2 at the bottom page you can select operating system that will be installed inside the VM. Based on the selected OS virt-manager picks q35 or i440fx. If it defaults to i440fx virt-manager gets domain capabilities from libvirt for i440fx only.

Later in the customize window if you switch chipset to q35 virt-manager will not refresh domain capabilities so it will not update the list of firmwares which is the bug here. The same happens the other way around. We need to fix it to refresh domain capabilities correctly when user switches chipset in the UI.

So there is an issue how QEMU is installed in Void Linux and there is a bug in virt-manager to not show correct firmwares if chipset is changed. I'll fix the virt-manager bug.

@pandom79
Copy link
Contributor

Hi @pandom79 so there is a bug in virt-manager GUI.

If you start creating new VM in the Step 2 at the bottom page you can select operating system that will be installed inside the VM. Based on the selected OS virt-manager picks q35 or i440fx. If it defaults to i440fx virt-manager gets domain capabilities from libvirt for i440fx only.

Later in the customize window if you switch chipset to q35 virt-manager will not refresh domain capabilities so it will not update the list of firmwares which is the bug here. The same happens the other way around. We need to fix it to refresh domain capabilities correctly when user switches chipset in the UI.

So there is an issue how QEMU is installed in Void Linux and there is a bug in virt-manager to not show correct firmwares if chipset is changed. I'll fix the virt-manager bug.

Hi @phrdina ,
I'll waiting your notice
thank you so much.
regards

@pandom79
Copy link
Contributor

I added a symlink from /usr/share/qemu/firmware to /usr/lib/qemu/firmware and it seems works well.
Now, libvirt finds the firmwares correctly except uefi secure boot.

@pandom79
Copy link
Contributor

@phrdina
small update: I tried to install windows 10 in virt manager. In this case, i can also choice uefi secure boot firmware both for q35 and i440fx. It works correctly.
At this point, i have a doubt: does it depend by iso file capability?
regards

@phrdina
Copy link
Author

phrdina commented Jul 22, 2020

@pandom79 No it doesn't depend on the ISO file. It depends on the selected or detected OS that you are installing inside the VM.
If you pick windows or it is detected it will pick Q35 as default machine type using osinfo project and virt-manager will get domain capabilities only for Q35 machine type which will contain secure boot firmware and non-secure boot firmware.

If the selected or detected OS will lead to i440FX it will contain only non-secure boot firmware.

The situation that you describe is not working correctly because if you change the machine type into i440FX the secure boot firmware should disappear as it will not work with i440FX.

@pandom79
Copy link
Contributor

@pandom79 No it doesn't depend on the ISO file. It depends on the selected or detected OS that you are installing inside the VM.
If you pick windows or it is detected it will pick Q35 as default machine type using osinfo project and virt-manager will get domain capabilities only for Q35 machine type which will contain secure boot firmware and non-secure boot firmware.

If the selected or detected OS will lead to i440FX it will contain only non-secure boot firmware.

The situation that you describe is not working correctly because if you change the machine type into i440FX the secure boot firmware should disappear as it will not work with .

sorry, you're right.
I shouldn't be seeing uefi secure-boot in case of i440FX.

Hoshpak added a commit to Hoshpak/void-packages that referenced this issue Sep 13, 2020
ignore foreign-arch elf files in /usr/share
fixes void-linux#23495
Hoshpak added a commit to Hoshpak/void-packages that referenced this issue Sep 13, 2020
ignore foreign-arch elf files in /usr/share
fixes void-linux#23495
[skip ci]
Hoshpak added a commit that referenced this issue Sep 14, 2020
ignore foreign-arch elf files in /usr/share
fixes #23495
[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants