qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [RFC PATCH 04/18] qemu: Introduce 'qemu/legacy_binary_info.h'
Date: Wed, 5 Mar 2025 20:19:21 +0100	[thread overview]
Message-ID: <CABgObfZNDHMiOeif8dbsxNptARQf22ZgYeREjqbcLYLD9xcwNw@mail.gmail.com> (raw)
In-Reply-To: <20250305153929.43687-5-philmd@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

Il mer 5 mar 2025, 16:39 Philippe Mathieu-Daudé <philmd@linaro.org> ha
scritto:

> +    for (size_t i = 0; i < ARRAY_SIZE(legacy_binary_infos); i++) {
> +        if (!strcmp(legacy_binary_infos[i].binary_name, binary_name)) {
> +            current_index = i;
> +            return;
> +        }
> +    }
> +    fprintf(stderr, "Missing legacy info for '%s' binary.\n",
> binary_name);
>

Wouldn't this crash if a binary is renamed to qemu-kvm or anything else but
its original name? There should be a default target in the binary, and this
function should only be called it there's none; but it should also use the
normal Error** interface instead of aborting.

Also do not call things legacy, as Pierrick also said and explained.

Paolo

+    abort();
> +}
> diff --git a/system/vl.c b/system/vl.c
> index a41ba4a2d5f..74a062c7fff 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -28,6 +28,7 @@
>  #include "qemu/units.h"
>  #include "qemu/module.h"
>  #include "qemu/arch_info.h"
> +#include "qemu/legacy_binary_info.h"
>  #include "exec/cpu-common.h"
>  #include "exec/page-vary.h"
>  #include "hw/qdev-properties.h"
> @@ -2883,6 +2884,7 @@ void qemu_init(int argc, char **argv)
>
>      error_init(argv[0]);
>      qemu_init_exec_dir(argv[0]);
> +    legacy_binary_info_init(argv[0]);
>
>      os_setup_limits();
>
> --
> 2.47.1
>
>

[-- Attachment #2: Type: text/html, Size: 2345 bytes --]

  parent reply	other threads:[~2025-03-05 19:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 15:39 [RFC PATCH 00/18] hw/microblaze: Quick single binary proof of concept Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 01/18] hw/xen/hvm: Fix Aarch64 typo Philippe Mathieu-Daudé
2025-03-05 16:53   ` Pierrick Bouvier
2025-03-06  1:35   ` Richard Henderson
2025-03-13  8:10   ` Michael Tokarev
2025-03-13  9:40     ` Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 02/18] hw/vfio/common: Get target page size using runtime helpers Philippe Mathieu-Daudé
2025-03-06  1:37   ` Richard Henderson
2025-03-05 15:39 ` [RFC PATCH 03/18] include: Poison TARGET_PHYS_ADDR_SPACE_BITS definition Philippe Mathieu-Daudé
2025-03-06  1:37   ` Richard Henderson
2025-03-05 15:39 ` [RFC PATCH 04/18] qemu: Introduce 'qemu/legacy_binary_info.h' Philippe Mathieu-Daudé
2025-03-05 16:59   ` Pierrick Bouvier
2025-03-06  7:26     ` Thomas Huth
2025-03-06  9:26       ` Philippe Mathieu-Daudé
2025-03-06 11:34         ` Paolo Bonzini
2025-03-06 11:52           ` Daniel P. Berrangé
2025-03-06 13:45             ` BALATON Zoltan
2025-03-06 15:15               ` Daniel P. Berrangé
2025-03-06 15:28                 ` BALATON Zoltan
2025-03-06 21:45                   ` Pierrick Bouvier
2025-03-07  0:46                     ` BALATON Zoltan
2025-03-05 19:19   ` Paolo Bonzini [this message]
2025-03-06  1:56   ` Richard Henderson
2025-03-06 12:13     ` Daniel P. Berrangé
2025-03-19 14:25     ` Philippe Mathieu-Daudé
2025-03-22  6:59       ` Markus Armbruster
2025-03-05 15:39 ` [RFC PATCH 05/18] qemu: Introduce legacy_binary_is_64bit() helper Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 06/18] hw/mips/mipssim: Replace TARGET_MIPS64 by legacy_binary_is_64bit() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 07/18] hw/mips/malta: " Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 08/18] hw/i386: Inline TARGET_DEFAULT_CPU_TYPE definition Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 09/18] hw/ppc/mac: Replace TARGET_PPC64 by legacy_binary_is_64bit() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 10/18] qemu: Introduce legacy_binary_is_big_endian() helper Philippe Mathieu-Daudé
2025-03-06  7:28   ` Thomas Huth
2025-03-06 14:10     ` Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 11/18] hw/mips/jazz: Replace TARGET_BIG_ENDIAN by legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 12/18] hw/mips/mipssim: Use legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 13/18] hw/xtensa/sim: Replace TARGET_BIG_ENDIAN by legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 14/18] hw/xtensa/xtfpga: Check endianness via legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 15/18] hw/microblaze/petalogix_ml605_mmu: Use legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 16/18] hw/microblaze/petalogix_s3adsp1800_mmu: Use legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 17/18] meson: Allow symlinking system emulation binaries Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 18/18] configs/targets: Merge qemu-system-microblaze{el} binaries Philippe Mathieu-Daudé

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=CABgObfZNDHMiOeif8dbsxNptARQf22ZgYeREjqbcLYLD9xcwNw@mail.gmail.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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).