qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] Add -build-info and -build-info-json CLI arguments


From: Manos Pitsidianakis
Subject: Re: [PATCH v2] Add -build-info and -build-info-json CLI arguments
Date: Tue, 24 Sep 2024 15:32:10 +0300

Hello Daniel,

On Tue, Sep 24, 2024, 3:08 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
On Tue, Sep 24, 2024 at 01:02:26PM +0100, Alex Bennée wrote:
> Manos Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
>
> > Hello Daniel,
> >
> > On Tue, 24 Sept 2024 at 11:45, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >>
> >> On Mon, Sep 23, 2024 at 10:09:32PM +0300, Manos Pitsidianakis wrote:
> >> > Hello Daniel,
> >> >
> >> > On Mon, 23 Sep 2024 19:45, "Daniel P. Berrangé" <berrange@redhat.com> wrote:
> >> > > On Mon, Sep 23, 2024 at 09:05:24AM +0300, Manos Pitsidianakis wrote:
> <snip>
> >> > > ie, look a query-audiodevs to discover what audio baxckends are
> >> > > built-in, don't look for CONFIG_XXX settings related to audio.
> >> > > If there are gaps in information we can query from QMP, we should
> >> > > aim to close those gaps.
> >> > >
> >> > > IOW, I don't think we should expose this build info info in either
> >> > > human readable or machine readable format.
> >> >
> >> > QAPI/QMP is not the perspective of this patch, this is for people who use
> >> > custom-built (i.e. not from a distro) binaries and want to be able to
> >> > identify how it was built. Launching a binary to query stuff is
> >> > unnecessarily complex for this task, and the info is not generally
> >> > interesting to the API consumers as you said.
> >>
> >> Launching QEMU to talk QMP is our defined public API for querying
> >> anything about the capabilities of QEMU. We're worked hard to get
> >> away from providing ad-hoc ways to query QEMU from the command
> >> line and going back to that is not desirable. It may be slightly
> >> more complicated, but not by very much.
> >
> > Again, this is not a "capabilities discovery" API. It lists the
> > build-time configuration of the binary. Perhaps we can expose it in a
> > different way so that people don't end up confused?
>
> I think the problem is however much we might say it's not a capabilities
> discovery API it's very existence encourages users to use it as one.
>
> What about a script:
>
>   qemu-get-build-info </path/to/qemu>
>
> which would launch the binary and query it over QMP? Would that work?

If this is purely a debugging aid, we could make use of ELF notes to
just stick the config-host.h content into the binary. This has precedent
in systemd package notes (https://github.com/systemd/package-notes) and
is more clearly *NOT* an end user CLI option, nor a public API in QMP.

Querying is then

    objdump -j .note.qemu-config-h -s /usrbin/qemu-system-x86_64

That's actually a way better solution! I will attempt it for the next revision.

Manos 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]