qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] Make QEMU installation relocatable
@ 2020-09-01  6:20 Paolo Bonzini
  2020-09-01  6:20 ` [PATCH 01/13] fuzz: use qemu_get_exec_dir Paolo Bonzini
                   ` (13 more replies)
  0 siblings, 14 replies; 36+ messages in thread
From: Paolo Bonzini @ 2020-09-01  6:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mark Cave-Ayland

Right now, the installation of QEMU is not relocatable; there is
a local hack in os_find_datadir() so that Windows binaries look
for ROMs in the executable directory, but that has several limitations:

- it does not extend to configuration files, icons, etc.

- it does not allow changing the data directory in any way

- it does not apply to POSIX platforms

This series fixes that by making all paths within the installation
prefix relative to the executable.  This in practice means all paths
will be relocatable, except for /etc and /var if they're moved
outside the prefix.

Here is an example of relocatability; before:

  $ make DESTDIR=$PWD/test install
  $ cd test/usr/local/bin
  $ ./qemu-system-ppc -L help
  /usr/local/share/qemu-firmware
  /usr/local/share/qemu

After:

  $ make DESTDIR=$PWD/test install
  $ cd test/usr/local/bin
  $ ./qemu-system-ppc -L help
  /home/pbonzini/work/upstream/qemu/+build/test/usr/local/bin/../share/qemu-firmware
  /home/pbonzini/work/upstream/qemu/+build/test/usr/local/bin/../share/qemu

The main benefit of this is on Windows, as mentioned above; but it also
makes behavior more consistent across platforms and allows the removal
of the hack that hides the "c:/Program Files/QEMU" prefix from Meson
during cross compilation.

Paolo

Paolo Bonzini (13):
  fuzz: use qemu_get_exec_dir
  oslib: do not call g_strdup from qemu_get_exec_dir
  oslib-posix: default exec_dir to bindir
  cutils: introduce get_relocated_path
  oslib-posix: relocate path to /var
  module: relocate path to modules
  net: relocate paths to helpers and scripts
  vl: relocate paths to data directories
  vl: relocate path to configuration file
  qemu-bridge-helper: relocate path to default ACL
  qga: relocate path to default configuration and hook
  ui: relocate paths to icons and translations
  configure: use a platform-neutral prefix

 configure               | 30 ++++++++------------
 include/net/net.h       |  4 +--
 include/qemu-common.h   |  1 -
 include/qemu/cutils.h   | 12 ++++++++
 include/qemu/osdep.h    |  8 ++----
 include/sysemu/sysemu.h |  2 +-
 meson.build             |  4 +--
 net/tap.c               | 28 ++++++++++++++-----
 os-posix.c              | 24 ----------------
 os-win32.c              | 11 --------
 qemu-bridge-helper.c    |  9 ++++--
 qga/main.c              |  8 ++++--
 softmmu/vl.c            | 43 ++++++++++++++++++++---------
 tests/qtest/fuzz/fuzz.c | 12 ++++----
 ui/gtk.c                | 10 +++++--
 ui/sdl2.c               |  9 ++++--
 util/cutils.c           | 61 +++++++++++++++++++++++++++++++++++++++++
 util/module.c           | 10 ++-----
 util/oslib-posix.c      | 35 +++++++++++------------
 util/oslib-win32.c      | 14 +++++++---
 20 files changed, 205 insertions(+), 130 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2020-09-02 20:21 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-01  6:20 [PATCH 00/13] Make QEMU installation relocatable Paolo Bonzini
2020-09-01  6:20 ` [PATCH 01/13] fuzz: use qemu_get_exec_dir Paolo Bonzini
2020-09-01  9:18   ` Thomas Huth
2020-09-01 14:36   ` Alexander Bulekov
2020-09-01  6:20 ` [PATCH 02/13] oslib: do not call g_strdup from qemu_get_exec_dir Paolo Bonzini
2020-09-02 10:30   ` Thomas Huth
2020-09-01  6:20 ` [PATCH 03/13] oslib-posix: default exec_dir to bindir Paolo Bonzini
2020-09-01 18:04   ` Richard Henderson
2020-09-01 18:40     ` Paolo Bonzini
2020-09-01  6:20 ` [PATCH 04/13] cutils: introduce get_relocated_path Paolo Bonzini
2020-09-01  6:20 ` [PATCH 05/13] oslib-posix: relocate path to /var Paolo Bonzini
2020-09-02  8:20   ` Philippe Mathieu-Daudé
2020-09-01  6:20 ` [PATCH 06/13] module: relocate path to modules Paolo Bonzini
2020-09-01  6:20 ` [PATCH 07/13] net: relocate paths to helpers and scripts Paolo Bonzini
2020-09-02  8:24   ` Philippe Mathieu-Daudé
2020-09-02  8:40     ` Paolo Bonzini
2020-09-01  6:20 ` [PATCH 08/13] vl: relocate paths to data directories Paolo Bonzini
2020-09-02  8:28   ` Philippe Mathieu-Daudé
2020-09-02  8:35     ` Paolo Bonzini
2020-09-02  8:41       ` Philippe Mathieu-Daudé
2020-09-01  6:20 ` [PATCH 09/13] vl: relocate path to configuration file Paolo Bonzini
2020-09-02  8:28   ` Philippe Mathieu-Daudé
2020-09-01  6:20 ` [PATCH 10/13] qemu-bridge-helper: relocate path to default ACL Paolo Bonzini
2020-09-01  6:20 ` [PATCH 11/13] qga: relocate path to default configuration and hook Paolo Bonzini
2020-09-01  6:20 ` [PATCH 12/13] ui: relocate paths to icons and translations Paolo Bonzini
2020-09-02  8:29   ` Philippe Mathieu-Daudé
2020-09-01  6:20 ` [PATCH 13/13] configure: use a platform-neutral prefix Paolo Bonzini
2020-09-01 21:14 ` [PATCH 00/13] Make QEMU installation relocatable Mark Cave-Ayland
2020-09-01 21:22   ` Paolo Bonzini
2020-09-02  6:09     ` Mark Cave-Ayland
2020-09-02  6:42       ` Paolo Bonzini
2020-09-02 11:42         ` Mark Cave-Ayland
2020-09-02 11:45           ` Mark Cave-Ayland
2020-09-02 12:16           ` Paolo Bonzini
2020-09-02 18:45             ` Mark Cave-Ayland
2020-09-02 20:20               ` Paolo Bonzini

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).