From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alexander Bulekov" <alxndr@bu.edu>,
"Bandan Das" <bsd@redhat.com>, "Thomas Huth" <thuth@redhat.com>,
"Volker Rümelin" <vr_qemu@t-online.de>,
"Darren Kenny" <darren.kenny@oracle.com>,
"Qiuhao Li" <Qiuhao.Li@outlook.com>,
"Jason Wang" <jasowang@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Akihiko Odaki" <akihiko.odaki@gmail.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH v3 0/4] softmmu: make qemu_find_file more flexible wrt build dir layout
Date: Wed, 15 Jun 2022 11:52:08 +0100 [thread overview]
Message-ID: <20220615105212.780256-1-berrange@redhat.com> (raw)
The qemu_find_file method impl is rather crude with a variety of
problems (detailed in commit message of first patch).
This series addresses those problems, making qemu_find_file
much more flexible and able to be trivially extended to find
any type of file, both in a (optionally relocated) install
tree location and the local build tree.
This is proposed as an alternative to
https://lists.gnu.org/archive/html/qemu-devel/2022-06/msg02589.html
avoiding the need to add many more meson rules to simulate
results of 'make install' in the build dir.
It has been tested as follows:
mkdir -p build/quick
cd build/quick
./configure --target-list=x86_64-softmmu --prefix=/usr
make -j 8 install DESTDIR=`pwd`/../vroot
Now running from build dir:
$ ./build/local/qemu-system-x86_64 -vnc :1 -k fr -trace 'datadir*' -display sdl
datadir_init default data dir /home/berrange/src/virt/qemu/build/local/../share/qemu icon dir /home/berrange/src/virt/qemu/build/local/../share/icons helper dir /home/berrange/src/virt/qemu/build/local/../libexec in build dir 1
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/local/pc-bios/bios-256k.bin errno 0
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/local/pc-bios/bios-256k.bin errno 0
datadir_load_file name kvmvapic.bin location /home/berrange/src/virt/qemu/build/local/pc-bios/kvmvapic.bin errno 0
datadir_load_file name vgabios-stdvga.bin location /home/berrange/src/virt/qemu/build/local/pc-bios/vgabios-stdvga.bin errno 0
datadir_load_file name efi-e1000.rom location /home/berrange/src/virt/qemu/build/local/pc-bios/efi-e1000.rom errno 0
datadir_load_file name 128x128/apps/qemu.png location /home/berrange/src/virt/qemu/build/local/ui/icons/128x128/apps/qemu.png errno 0
datadir_load_file name fr location /home/berrange/src/virt/qemu/build/local/ui/keymaps/fr errno 0
$ ./build/local/qemu-system-x86_64 -vnc :1 -k fr -trace 'datadir*' -display sdl -net bridge
datadir_init default data dir /home/berrange/src/virt/qemu/build/local/../share/qemu icon dir /home/berrange/src/virt/qemu/build/local/../share/icons helper dir /home/berrange/src/virt/qemu/build/local/../libexec in build dir 1
datadir_load_file name qemu-bridge-helper location /home/berrange/src/virt/qemu/build/local/qemu-bridge-helper errno 0
Helper /home/berrange/src/virt/qemu/build/local/qemu-bridge-helper
access denied by acl file
And running from the (relocated) install dir:
$ ./build/vroot/usr/bin/qemu-system-x86_64 -vnc :1 -k fr -trace 'datadir*' -display sdl
datadir_init default data dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu icon dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/icons helper dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../libexec in build dir 0
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../qemu-firmware/bios-256k.bin errno 2
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/bios-256k.bin errno 0
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../qemu-firmware/bios-256k.bin errno 2
datadir_load_file name bios-256k.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/bios-256k.bin errno 0
datadir_load_file name kvmvapic.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../qemu-firmware/kvmvapic.bin errno 2
datadir_load_file name kvmvapic.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/kvmvapic.bin errno 0
datadir_load_file name vgabios-stdvga.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../qemu-firmware/vgabios-stdvga.bin errno 2
datadir_load_file name vgabios-stdvga.bin location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/vgabios-stdvga.bin errno 0
datadir_load_file name efi-e1000.rom location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../qemu-firmware/efi-e1000.rom errno 2
datadir_load_file name efi-e1000.rom location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/efi-e1000.rom errno 0
datadir_load_file name 128x128/apps/qemu.png location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/icons/hicolor/128x128/apps/qemu.png errno 0
datadir_load_file name fr location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu/keymaps/fr errno 0
$ ./build/vroot/usr/bin/qemu-system-x86_64 -vnc :1 -k fr -trace 'datadir*' -display sdl -net bridge
datadir_init default data dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/qemu icon dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../share/icons helper dir /home/berrange/src/virt/qemu/build/vroot/usr/bin/../libexec in build dir 0
datadir_load_file name qemu-bridge-helper location /home/berrange/src/virt/qemu/build/vroot/usr/bin/../libexec/qemu-bridge-helper errno 0
Helper /home/berrange/src/virt/qemu/build/vroot/usr/bin/../libexec/qemu-bridge-helper
access denied by acl file
These trace messages show it searching the correct paths to find the
files in both installed and build root cases.
NB, I've been unable to actually test the cocoa.m change since I
lack macOS.
Daniel P. Berrangé (4):
softmmu: rewrite handling of qemu_find_file
ui: move 'pc-bios/keymaps' to 'ui/keymaps'
ui: find icons using qemu_find_file
net: convert to use qemu_find_file to locate bridge helper
configure | 1 +
docs/conf.py | 4 +-
include/net/net.h | 3 +-
include/qemu/datadir.h | 8 +-
net/tap.c | 5 +-
pc-bios/meson.build | 1 -
qemu-options.hx | 4 +-
softmmu/datadir.c | 164 +++++++++++-------
softmmu/trace-events | 5 +-
softmmu/vl.c | 2 +-
tests/qtest/fuzz/fuzz.c | 2 +-
ui/cocoa.m | 3 +-
ui/gtk.c | 3 +-
.../apps/qemu.png} | Bin
.../{qemu_16x16.png => 16x16/apps/qemu.png} | Bin
.../{qemu_24x24.png => 24x24/apps/qemu.png} | Bin
.../apps/qemu.png} | Bin
.../{qemu_32x32.bmp => 32x32/apps/qemu.bmp} | Bin
.../{qemu_32x32.png => 32x32/apps/qemu.png} | Bin
.../{qemu_48x48.png => 48x48/apps/qemu.png} | Bin
.../apps/qemu.png} | Bin
.../{qemu_64x64.png => 64x64/apps/qemu.png} | Bin
ui/icons/meson.build | 27 ++-
ui/icons/{ => scalable/apps}/qemu.svg | 0
{pc-bios => ui}/keymaps/ar | 0
{pc-bios => ui}/keymaps/bepo | 0
{pc-bios => ui}/keymaps/cz | 0
{pc-bios => ui}/keymaps/da | 0
{pc-bios => ui}/keymaps/de | 0
{pc-bios => ui}/keymaps/de-ch | 0
{pc-bios => ui}/keymaps/en-gb | 0
{pc-bios => ui}/keymaps/en-us | 0
{pc-bios => ui}/keymaps/es | 0
{pc-bios => ui}/keymaps/et | 0
{pc-bios => ui}/keymaps/fi | 0
{pc-bios => ui}/keymaps/fo | 0
{pc-bios => ui}/keymaps/fr | 0
{pc-bios => ui}/keymaps/fr-be | 0
{pc-bios => ui}/keymaps/fr-ca | 0
{pc-bios => ui}/keymaps/fr-ch | 0
{pc-bios => ui}/keymaps/hr | 0
{pc-bios => ui}/keymaps/hu | 0
{pc-bios => ui}/keymaps/is | 0
{pc-bios => ui}/keymaps/it | 0
{pc-bios => ui}/keymaps/ja | 0
{pc-bios => ui}/keymaps/lt | 0
{pc-bios => ui}/keymaps/lv | 0
{pc-bios => ui}/keymaps/meson.build | 0
{pc-bios => ui}/keymaps/mk | 0
{pc-bios => ui}/keymaps/nl | 0
{pc-bios => ui}/keymaps/no | 0
{pc-bios => ui}/keymaps/pl | 0
{pc-bios => ui}/keymaps/pt | 0
{pc-bios => ui}/keymaps/pt-br | 0
{pc-bios => ui}/keymaps/ru | 0
{pc-bios => ui}/keymaps/sl | 0
{pc-bios => ui}/keymaps/sv | 0
{pc-bios => ui}/keymaps/th | 0
{pc-bios => ui}/keymaps/tr | 0
ui/meson.build | 1 +
ui/sdl2.c | 5 +-
61 files changed, 152 insertions(+), 86 deletions(-)
rename ui/icons/{qemu_128x128.png => 128x128/apps/qemu.png} (100%)
rename ui/icons/{qemu_16x16.png => 16x16/apps/qemu.png} (100%)
rename ui/icons/{qemu_24x24.png => 24x24/apps/qemu.png} (100%)
rename ui/icons/{qemu_256x256.png => 256x256/apps/qemu.png} (100%)
rename ui/icons/{qemu_32x32.bmp => 32x32/apps/qemu.bmp} (100%)
rename ui/icons/{qemu_32x32.png => 32x32/apps/qemu.png} (100%)
rename ui/icons/{qemu_48x48.png => 48x48/apps/qemu.png} (100%)
rename ui/icons/{qemu_512x512.png => 512x512/apps/qemu.png} (100%)
rename ui/icons/{qemu_64x64.png => 64x64/apps/qemu.png} (100%)
rename ui/icons/{ => scalable/apps}/qemu.svg (100%)
rename {pc-bios => ui}/keymaps/ar (100%)
rename {pc-bios => ui}/keymaps/bepo (100%)
rename {pc-bios => ui}/keymaps/cz (100%)
rename {pc-bios => ui}/keymaps/da (100%)
rename {pc-bios => ui}/keymaps/de (100%)
rename {pc-bios => ui}/keymaps/de-ch (100%)
rename {pc-bios => ui}/keymaps/en-gb (100%)
rename {pc-bios => ui}/keymaps/en-us (100%)
rename {pc-bios => ui}/keymaps/es (100%)
rename {pc-bios => ui}/keymaps/et (100%)
rename {pc-bios => ui}/keymaps/fi (100%)
rename {pc-bios => ui}/keymaps/fo (100%)
rename {pc-bios => ui}/keymaps/fr (100%)
rename {pc-bios => ui}/keymaps/fr-be (100%)
rename {pc-bios => ui}/keymaps/fr-ca (100%)
rename {pc-bios => ui}/keymaps/fr-ch (100%)
rename {pc-bios => ui}/keymaps/hr (100%)
rename {pc-bios => ui}/keymaps/hu (100%)
rename {pc-bios => ui}/keymaps/is (100%)
rename {pc-bios => ui}/keymaps/it (100%)
rename {pc-bios => ui}/keymaps/ja (100%)
rename {pc-bios => ui}/keymaps/lt (100%)
rename {pc-bios => ui}/keymaps/lv (100%)
rename {pc-bios => ui}/keymaps/meson.build (100%)
rename {pc-bios => ui}/keymaps/mk (100%)
rename {pc-bios => ui}/keymaps/nl (100%)
rename {pc-bios => ui}/keymaps/no (100%)
rename {pc-bios => ui}/keymaps/pl (100%)
rename {pc-bios => ui}/keymaps/pt (100%)
rename {pc-bios => ui}/keymaps/pt-br (100%)
rename {pc-bios => ui}/keymaps/ru (100%)
rename {pc-bios => ui}/keymaps/sl (100%)
rename {pc-bios => ui}/keymaps/sv (100%)
rename {pc-bios => ui}/keymaps/th (100%)
rename {pc-bios => ui}/keymaps/tr (100%)
--
2.36.1
next reply other threads:[~2022-06-15 10:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 10:52 Daniel P. Berrangé [this message]
2022-06-15 10:52 ` [PATCH v3 1/4] softmmu: rewrite handling of qemu_find_file Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 2/4] ui: move 'pc-bios/keymaps' to 'ui/keymaps' Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 3/4] ui: find icons using qemu_find_file Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 4/4] net: convert to use qemu_find_file to locate bridge helper Daniel P. Berrangé
2022-06-15 11:42 ` Paolo Bonzini
2022-06-15 12:04 ` Daniel P. Berrangé
2022-06-15 16:47 ` Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220615105212.780256-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=Qiuhao.Li@outlook.com \
--cc=akihiko.odaki@gmail.com \
--cc=alxndr@bu.edu \
--cc=bsd@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=f4bug@amsat.org \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=vr_qemu@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).