Bug 1804196 - inconsistent paths for interop json files
Summary: inconsistent paths for interop json files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.4
Assignee: Stefan Hajnoczi
QA Contact: FuXiangChun
URL:
Whiteboard:
Depends On:
Blocks: 1796871 1805324 1957194 1966580
TreeView+ depends on / blocked
 
Reported: 2020-02-18 12:36 UTC by Ján Tomko
Modified: 2021-11-16 07:56 UTC (History)
18 users (show)

Fixed In Version: qemu-kvm-6.0.0-23.module+el8.5.0+11740+35571f13
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 07:49:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
jinzhao: needinfo-
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 191782 0 None None None 2021-03-03 17:22:31 UTC

Internal Links: 1886739 1928180

Description Ján Tomko 2020-02-18 12:36:20 UTC
Description of problem:

According to the upstream docs file docs/interop/vhost-user.json

# [...] The backend JSON files should be searched for in three
# directories:
#
#   - /usr/share/qemu/vhost-user -- populated by distro-provided
#                                   packages (XDG_DATA_DIRS covers
#                                   /usr/share by default),
#
#   - /etc/qemu/vhost-user -- exclusively for sysadmins' local additions,
#
#   - $XDG_CONFIG_HOME/qemu/vhost-user -- exclusively for per-user local
#                                         additions (XDG_CONFIG_HOME
#                                         defaults to $HOME/.config).

However qemu-kvm's downstream specfile overrides the 'confsuffix'
to 'qemu-kvm' instead of 'qemu', resulting in these files being
installed in /usr/share/qemu-kvm/vhost-user:
# rpm -qf /usr/share/qemu-kvm/vhost-user/50-qemu-gpu.json
qemu-kvm-core-4.2.0-1.module+el8.2.0+4793+b09dd2fb.x86_64



docs/interop/firmware.json also mentions the path:
#   - /usr/share/qemu/firmware -- populated by distro-provided firmware
#                                 packages (XDG_DATA_DIRS covers
#                                 /usr/share by default),

Which matches the location where edk2-ovmf installs it.

# rpm -qf /usr/share/qemu/firmware/50-edk2-ovmf.json
edk2-ovmf-20190829git37eef91017ad-7.el8.noarch


Version-Release number of selected component (if applicable):
qemu-kvm-core-4.2.0-1.module+el8.2.0+4793+b09dd2fb.x86_64
edk2-ovmf-20190829git37eef91017ad-7.el8.noarch

How reproducible:
0x64 %

Expected results:
The documented path is honored.

Additional info:
Currently, libvirt only looks into /usr/share/qemu, which has worked so far
because the firmware packages honor it.
The motivation for this bug is the usage of 50-qemu-virtiofsd.json:
https://www.redhat.com/archives/libvir-list/2020-February/msg00109.html

Comment 2 FuXiangChun 2020-02-26 02:51:39 UTC
Reproduced this issue. 
# rpm -qf /usr/share/qemu-kvm/vhost-user/50-qemu-gpu.json
qemu-kvm-core-4.2.0-12.module+el8.2.0+5858+afd073bc.x86_64

The firmware packages location is correct
# rpm -qf /usr/share/qemu/firmware/50-edk2-ovmf.json
edk2-ovmf-20190829git37eef91017ad-8.el8.noarch

Comment 5 Eugenio Pérez Martín 2020-09-11 09:20:23 UTC
Hi Ján.

I'm not sure if I understand your proposal. From my point of view, the right fix to this would be to update the docs and the firmware packages to install files under qemu-kvm dirs. But it seems to me that you are proposing the other way around, to make qemu look for them in regular directories ignoring PREFIX, CONFSUFFIX... is that correct?

Thanks!

Comment 9 Ján Tomko 2020-12-14 11:51:26 UTC
(In reply to Eugenio Pérez Martín from comment #5)
> Hi Ján.
> 
> I'm not sure if I understand your proposal. From my point of view, the right
> fix to this would be to update the docs and the firmware packages to install
> files under qemu-kvm dirs.

Yes, this would be one way to achieve consistency.

> But it seems to me that you are proposing the
> other way around, to make qemu look for them in regular directories ignoring
> PREFIX, CONFSUFFIX... is that correct?
> 

Ignoring CONFSUFFIX (at least for these files that are to be used by external
tools) looks like the cleaner solution for me - but maybe I lack the necessary
insight to make that claim. IIRC the CONFSUFFIX machinery was introduced to
upstream QEMU around the time of dowstream qemu-kvm/qemu-kvm-rhev split, so
it should not be necessary nowadays.

> Thanks!

Comment 12 Stefan Hajnoczi 2021-06-10 07:32:04 UTC
A non-standard downstream path allows downstream software to be
installed alongside upstream software on the same machine without
conflicts, but I'm not sure that's the goal here.

The non-standard path also exists for legacy reasons in some cases because QEMU and qemu-kvm used to be two separate programs, that doesn't apply here.

The non-standard path is problematic because there will be more
vhost-user software in the future. Making each piece of software solve the "qemu" vs "qemu-kvm" issue on RHEL will waste time, so a solution is needed.

I suggest using /usr/share/qemu/vhost-user/ as the location in
compliance with the spec. This way other VMMs and vhost-user device
backend programs can interoperate.

Comment 15 Stefan Hajnoczi 2021-06-21 12:44:48 UTC
> If not, would it be ok to just do a `mv` or a `ln -s` in the qemu-kvm package in the spec?

Yes, I think that's the simplest solution.

I'll try to send a patch that does this and see if the downstream maintainers, Daniel Berrangé, and Marc-André Lureau agree.

Comment 18 Danilo de Paula 2021-07-02 21:48:38 UTC
QA_ACK, please?

Comment 23 Yanan Fu 2021-07-09 05:36:50 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 24 FuXiangChun 2021-07-13 00:59:20 UTC
Reproduced with qemu-kvm-core-6.0.0-22.module+el8.5.0+11677+542c8d77.x86_64.

# rpm -qf /usr/share/qemu-kvm/vhost-user/50-qemu-virtiofsd.json 
qemu-kvm-common-6.0.0-22.module+el8.5.0+11677+542c8d77.x86_64

Verified with qemu-kvm-core-6.0.0-23.module+el8.5.0+11740+35571f13.x86_64

/usr/share/qemu-kvm/vhost-user/ location to the standard /usr/share/qemu/vhost-user/ location

# rpm -qf /usr/share/qemu/vhost-user/50-qemu-virtiofsd.json 
qemu-kvm-common-6.0.0-23.module+el8.5.0+11740+35571f13.x86_64

Set this as verified.

If I missed anything, please let QE know.

Comment 26 errata-xmlrpc 2021-11-16 07:49:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684


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