[PATCH v8 0/4] cutils: Introduce bundle mechanism

Akihiko Odaki posted 4 patches 1 year, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220624145039.49929-1-akihiko.odaki@gmail.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Paolo Bonzini <pbonzini@redhat.com>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>
There is a newer version of this series
.travis.yml                     |  2 +-
docs/about/build-platforms.rst  |  2 +-
include/qemu/cutils.h           | 18 +++++++--
meson.build                     |  4 ++
pc-bios/keymaps/meson.build     | 21 +++-------
pc-bios/meson.build             | 13 ++-----
scripts/oss-fuzz/build.sh       |  2 +-
scripts/symlink-install-tree.py | 37 ++++++++++++++++++
softmmu/datadir.c               | 22 +----------
tests/qtest/fuzz/fuzz.c         | 15 --------
tests/vm/fedora                 |  1 -
tests/vm/freebsd                |  1 -
tests/vm/netbsd                 |  1 -
tests/vm/openbsd                |  1 -
util/cutils.c                   | 68 +++++++++++++++++++++++----------
util/meson.build                |  1 +
util/module.c                   |  1 -
17 files changed, 117 insertions(+), 93 deletions(-)
create mode 100755 scripts/symlink-install-tree.py
[PATCH v8 0/4] cutils: Introduce bundle mechanism
Posted by Akihiko Odaki 1 year, 10 months ago
Developers often run QEMU without installing. The bundle mechanism
allows to look up files which should be present in installation even in
such a situation.

It is a general mechanism and can find any files located relative
to the installation tree. The build tree must have a new directory,
qemu-bundle, to represent what files the installation tree would
have for reference by the executables.

Note that this abandons compatibility with Windows older than 8 to use
PathCchSkipRoot(). The extended support for the prior version, 7 ended
more than 2 years ago, and it is unlikely that anyone would like to run
the latest QEMU on such an old system.

v8:
* Pass absolute paths to get_relocated_path() (Paolo Bonzini)
* Use meson introspection (Paolo Bonzini)
* Drop "qga: Relocate a path emitted in the help text" as it is no longer
  relevant for the bundle mechanism.

v7: Properly fix --firmwarepath (Daniel P. Berrangé)

v6: Reuse get_relocated_path() in find_bundle() (Paolo Bonzini)

v5:
* Prefer qemu-bundle if it exists. (Daniel P. Berrangé)
* Check install_blobs option before installing BIOSes (Paolo Bonzini)
* Add common code to set up qemu-bundle to the top level meson.build
  (Paolo Bonzini)

v4:
* Add Daniel P. Berrangé to CC. Hopefully this helps merging his patch:
  https://mail.gnu.org/archive/html/qemu-devel/2022-06/msg02276.html
* Rebased to the latest QEMU.

v3:
* Note that the bundle mechanism is for any files located relative to the
  installation tree including but not limited to datadir. (Peter Maydell)
* Fix "bridge" typo (Philippe Mathieu-Daudé)

v2: Rebased to the latest QEMU.

Akihiko Odaki (3):
  cutils: Introduce bundle mechanism
  datadir: Use bundle mechanism
  module: Use bundle mechanism

Paolo Bonzini (1):
  tests/vm: do not specify -bios option

 .travis.yml                     |  2 +-
 docs/about/build-platforms.rst  |  2 +-
 include/qemu/cutils.h           | 18 +++++++--
 meson.build                     |  4 ++
 pc-bios/keymaps/meson.build     | 21 +++-------
 pc-bios/meson.build             | 13 ++-----
 scripts/oss-fuzz/build.sh       |  2 +-
 scripts/symlink-install-tree.py | 37 ++++++++++++++++++
 softmmu/datadir.c               | 22 +----------
 tests/qtest/fuzz/fuzz.c         | 15 --------
 tests/vm/fedora                 |  1 -
 tests/vm/freebsd                |  1 -
 tests/vm/netbsd                 |  1 -
 tests/vm/openbsd                |  1 -
 util/cutils.c                   | 68 +++++++++++++++++++++++----------
 util/meson.build                |  1 +
 util/module.c                   |  1 -
 17 files changed, 117 insertions(+), 93 deletions(-)
 create mode 100755 scripts/symlink-install-tree.py

-- 
2.32.1 (Apple Git-133)


Re: [PATCH v8 0/4] cutils: Introduce bundle mechanism
Posted by Paolo Bonzini 1 year, 10 months ago
On 6/24/22 16:50, Akihiko Odaki wrote:
> Developers often run QEMU without installing. The bundle mechanism
> allows to look up files which should be present in installation even in
> such a situation.
> 
> It is a general mechanism and can find any files located relative
> to the installation tree. The build tree must have a new directory,
> qemu-bundle, to represent what files the installation tree would
> have for reference by the executables.
> 
> Note that this abandons compatibility with Windows older than 8 to use
> PathCchSkipRoot(). The extended support for the prior version, 7 ended
> more than 2 years ago, and it is unlikely that anyone would like to run
> the latest QEMU on such an old system.

Thanks, this looks good.  Even though technically it adds more lines 
than it removes (thanks Windows...), it replaces lots of special cases 
with a single general mechanism, which is nice and future proof.

The only change I'd make (which I can do when queueing the patch) is to 
change the directory name to something "strange" like "=install", so 
that it's unlikely to have a directory named like that in the $bindir.

Any opinions?

Paolo

> v8:
> * Pass absolute paths to get_relocated_path() (Paolo Bonzini)
> * Use meson introspection (Paolo Bonzini)
> * Drop "qga: Relocate a path emitted in the help text" as it is no longer
>    relevant for the bundle mechanism.
> 
> v7: Properly fix --firmwarepath (Daniel P. Berrangé)
> 
> v6: Reuse get_relocated_path() in find_bundle() (Paolo Bonzini)
> 
> v5:
> * Prefer qemu-bundle if it exists. (Daniel P. Berrangé)
> * Check install_blobs option before installing BIOSes (Paolo Bonzini)
> * Add common code to set up qemu-bundle to the top level meson.build
>    (Paolo Bonzini)
> 
> v4:
> * Add Daniel P. Berrangé to CC. Hopefully this helps merging his patch:
>    https://mail.gnu.org/archive/html/qemu-devel/2022-06/msg02276.html
> * Rebased to the latest QEMU.
> 
> v3:
> * Note that the bundle mechanism is for any files located relative to the
>    installation tree including but not limited to datadir. (Peter Maydell)
> * Fix "bridge" typo (Philippe Mathieu-Daudé)
> 
> v2: Rebased to the latest QEMU.
> 
> Akihiko Odaki (3):
>    cutils: Introduce bundle mechanism
>    datadir: Use bundle mechanism
>    module: Use bundle mechanism
> 
> Paolo Bonzini (1):
>    tests/vm: do not specify -bios option
> 
>   .travis.yml                     |  2 +-
>   docs/about/build-platforms.rst  |  2 +-
>   include/qemu/cutils.h           | 18 +++++++--
>   meson.build                     |  4 ++
>   pc-bios/keymaps/meson.build     | 21 +++-------
>   pc-bios/meson.build             | 13 ++-----
>   scripts/oss-fuzz/build.sh       |  2 +-
>   scripts/symlink-install-tree.py | 37 ++++++++++++++++++
>   softmmu/datadir.c               | 22 +----------
>   tests/qtest/fuzz/fuzz.c         | 15 --------
>   tests/vm/fedora                 |  1 -
>   tests/vm/freebsd                |  1 -
>   tests/vm/netbsd                 |  1 -
>   tests/vm/openbsd                |  1 -
>   util/cutils.c                   | 68 +++++++++++++++++++++++----------
>   util/meson.build                |  1 +
>   util/module.c                   |  1 -
>   17 files changed, 117 insertions(+), 93 deletions(-)
>   create mode 100755 scripts/symlink-install-tree.py
> 


Re: [PATCH v8 0/4] cutils: Introduce bundle mechanism
Posted by Akihiko Odaki 1 year, 10 months ago
On 2022/06/25 0:26, Paolo Bonzini wrote:
> The only change I'd make (which I can do when queueing the patch) is to 
> change the directory name to something "strange" like "=install", so 
> that it's unlikely to have a directory named like that in the $bindir.
> 
> Any opinions?

Actually I prepended qemu- to the directory because all executables of 
QEMU has the prefix. We can safely say QEMU installation will never 
collide if no file prefixed with qemu- exists in the bindir.

If anyone has an idea what should follow "qemu-", please tell us.

Regards,
Akihiko Odaki