Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-05-08 Thread Pierrick Bouvier
On 5/7/25 12:55 AM, Markus Armbruster wrote: [...] - First, it's already broken because we rely on ifdef that won't be there in Rust or Go. I don't think it's broken. QAPI 'if' translates straightforwardly to C #if, but that doesn't mean it cannot be translated to conditional compilation / m

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-05-08 Thread Pierrick Bouvier
On 5/7/25 4:32 AM, Daniel P. Berrangé wrote: On Wed, May 07, 2025 at 09:55:13AM +0200, Markus Armbruster wrote: Pierrick Bouvier writes: [...] I don't think we should think too much ahead for languages other than C, for one, two, and even three reasons :) I agree that thinking ahead too mu

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-05-07 Thread Daniel P . Berrangé via Devel
On Wed, May 07, 2025 at 09:55:13AM +0200, Markus Armbruster wrote: > Pierrick Bouvier writes: > > [...] > > > I don't think we should think too much ahead for languages other than C, > > for one, two, and even three reasons :) > > I agree that thinking ahead too much is a bad habit. So is thi

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-05-07 Thread Markus Armbruster via Devel
Daniel P. Berrangé writes: > On Tue, Apr 29, 2025 at 09:43:24AM +0200, Markus Armbruster wrote: >> Pierrick Bouvier writes: >> >> > After looking at the introspection code, I don't see any major blocker. >> > We need to keep some of existing "if", as they are based on config-host, >> > and sho

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-05-07 Thread Markus Armbruster via Devel
Pierrick Bouvier writes: [...] > I don't think we should think too much ahead for languages other than C, > for one, two, and even three reasons :) I agree that thinking ahead too much is a bad habit. So is thinking ahead too little :) > - First, it's already broken because we rely on ifdef

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 10:40 PM, Thomas Huth wrote: On 29/04/2025 21.48, Pierrick Bouvier wrote: ... I'm not keen to have a default target set, but it's a personal opinion based on fear of "implicit smart choice hurts", so I'll be happy to change my mind with a good argument for it. No default target, ple

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 12:57 PM, Pierrick Bouvier wrote: On 4/29/25 2:35 AM, Philippe Mathieu-Daudé wrote: If a distro wants to name a binary 'qemu-kvm' it can drop the -target option and hard-wire its target_info() to a distro-specific TargetInfo implementation, or &target_info_x86_64_system. Having upd

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 2:35 AM, Philippe Mathieu-Daudé wrote: If a distro wants to name a binary 'qemu-kvm' it can drop the -target option and hard-wire its target_info() to a distro-specific TargetInfo implementation, or &target_info_x86_64_system. Having updated my Debian stable to next stable (trixie)

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 2:20 AM, Thomas Huth wrote: On 29/04/2025 10.23, Markus Armbruster wrote: ... I don't wish to derail this thread, but we've been dancing around the question of how to best fix the target for some time. I think we should talk about it for real. Sure, and no problem about that, that

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 1:37 AM, Daniel P. Berrangé wrote: On Tue, Apr 29, 2025 at 09:43:24AM +0200, Markus Armbruster wrote: Pierrick Bouvier writes: After looking at the introspection code, I don't see any major blocker. We need to keep some of existing "if", as they are based on config-host, and should

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-30 Thread Pierrick Bouvier
On 4/29/25 12:43 AM, Markus Armbruster wrote: Pierrick Bouvier writes: On 4/25/25 11:21 PM, Markus Armbruster wrote: Trouble is some uses of the second kind are in QAPI conditionals. I can see three options: (1) Drop these conditionals. (2) Replace them by run-time checks. (3) Have target

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Thomas Huth via Devel
On 29/04/2025 21.48, Pierrick Bouvier wrote: ... I'm not keen to have a default target set, but it's a personal opinion based on fear of "implicit smart choice hurts", so I'll be happy to change my mind with a good argument for it. No default target, please! We've seen this with the default ma

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread BALATON Zoltan
On Tue, 29 Apr 2025, Markus Armbruster wrote: Pierrick Bouvier writes: On 4/28/25 4:07 AM, Markus Armbruster wrote: Peter Krempa writes: So what should libvirt do once multiple targets are supported? How do we query CPUs for each of the supported targets? It's kind of a similar question

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Daniel P . Berrangé via Devel
On Tue, Apr 29, 2025 at 11:35:52AM +0200, Philippe Mathieu-Daudé wrote: > On 29/4/25 10:23, Markus Armbruster wrote: > > Pierrick Bouvier writes: > > > > > On 4/28/25 4:07 AM, Markus Armbruster wrote: > > > > Peter Krempa writes: > > > > > > > > > So what should libvirt do once multiple targets

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Philippe Mathieu-Daudé
On 29/4/25 11:32, Daniel P. Berrangé wrote: On Tue, Apr 29, 2025 at 11:20:59AM +0200, Thomas Huth via Devel wrote: On 29/04/2025 10.23, Markus Armbruster wrote: ... I don't wish to derail this thread, but we've been dancing around the question of how to best fix the target for some time. I thi

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Philippe Mathieu-Daudé
On 29/4/25 10:23, Markus Armbruster wrote: Pierrick Bouvier writes: On 4/28/25 4:07 AM, Markus Armbruster wrote: Peter Krempa writes: So what should libvirt do once multiple targets are supported? How do we query CPUs for each of the supported targets? It's kind of a similar question w

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Daniel P . Berrangé via Devel
On Tue, Apr 29, 2025 at 11:20:59AM +0200, Thomas Huth via Devel wrote: > On 29/04/2025 10.23, Markus Armbruster wrote: > ... > > I don't wish to derail this thread, but we've been dancing around the > > question of how to best fix the target for some time. I think we should > > talk about it for r

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Thomas Huth via Devel
On 29/04/2025 10.23, Markus Armbruster wrote: ... I don't wish to derail this thread, but we've been dancing around the question of how to best fix the target for some time. I think we should talk about it for real. Mind, this is not an objection to your larger "single binary" idea. It could b

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Daniel P . Berrangé via Devel
On Tue, Apr 29, 2025 at 09:43:24AM +0200, Markus Armbruster wrote: > Pierrick Bouvier writes: > > > After looking at the introspection code, I don't see any major blocker. > > We need to keep some of existing "if", as they are based on config-host, > > and should apply. > > We can introduce a ne

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Markus Armbruster via Devel
Pierrick Bouvier writes: > On 4/28/25 4:07 AM, Markus Armbruster wrote: >> Peter Krempa writes: >> >>> So what should libvirt do once multiple targets are supported? >>> >>> How do we query CPUs for each of the supported targets? >>> > > It's kind of a similar question we have to solve now with

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Pierrick Bouvier
On 4/28/25 3:25 AM, Peter Krempa wrote: On Fri, Apr 25, 2025 at 14:07:34 -0700, Pierrick Bouvier wrote: On 4/25/25 08:38, Markus Armbruster wrote: Pierrick Bouvier writes: Note: This RFC was posted to trigger a discussion around this topic, and it's not expected to merge it as it is. Contex

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Markus Armbruster via Devel
Pierrick Bouvier writes: > On 4/25/25 11:21 PM, Markus Armbruster wrote: >> Trouble is some uses of the second kind are in QAPI conditionals. I can >> see three options: >> >> (1) Drop these conditionals. >> >> (2) Replace them by run-time checks. >> >> (3) Have target-specific QAPI-generated

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-29 Thread Pierrick Bouvier
On 4/28/25 4:07 AM, Markus Armbruster wrote: Peter Krempa writes: So what should libvirt do once multiple targets are supported? How do we query CPUs for each of the supported targets? It's kind of a similar question we have to solve now with QEMU code. What happens when a symbol is duplic

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Pierrick Bouvier
On 4/25/25 11:21 PM, Markus Armbruster wrote: Trouble is some uses of the second kind are in QAPI conditionals. I can see three options: (1) Drop these conditionals. (2) Replace them by run-time checks. (3) Have target-specific QAPI-generated code for multiple targets coexist in the sing

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Philippe Mathieu-Daudé
On 28/4/25 13:07, Markus Armbruster wrote: Peter Krempa writes: The second thing that libvirt does after 'query-version' is 'query-target'. So what should libvirt do once multiple targets are supported? How do we query CPUs for each of the supported targets? Will the result be the same if

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Markus Armbruster via Devel
Peter Krempa writes: > On Fri, Apr 25, 2025 at 17:38:44 +0200, Markus Armbruster via Devel wrote: >> Pierrick Bouvier writes: > > [...] > >> To be precise: conditionals that use macros restricted to >> target-specific code, i.e. the ones poisoned by exec/poison.h. Let's >> call them target-spec

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Peter Krempa via Devel
On Fri, Apr 25, 2025 at 14:07:34 -0700, Pierrick Bouvier wrote: > On 4/25/25 08:38, Markus Armbruster wrote: > > Pierrick Bouvier writes: > > > > > Note: This RFC was posted to trigger a discussion around this topic, and > > > it's > > > not expected to merge it as it is. > > > > > > Context >

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Peter Krempa via Devel
On Fri, Apr 25, 2025 at 17:38:44 +0200, Markus Armbruster via Devel wrote: > Pierrick Bouvier writes: [...] > To be precise: conditionals that use macros restricted to > target-specific code, i.e. the ones poisoned by exec/poison.h. Let's > call them target-specific QAPI conditionals. > > The

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Pierrick Bouvier
On 4/25/25 14:07, Pierrick Bouvier wrote: QAPI/QMP introspection has all commands and events, and all types reachable from them. query-qmp-schema returns an array, where each array element describes one command, event, or type. When a command, event, or type is conditional in the schema, the el

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-28 Thread Pierrick Bouvier
On 4/25/25 08:38, Markus Armbruster wrote: Pierrick Bouvier writes: Note: This RFC was posted to trigger a discussion around this topic, and it's not expected to merge it as it is. Context === Linaro is working towards heterogeneous emulation, mixing several architectures in a single QEM

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-25 Thread Markus Armbruster via Devel
Pierrick Bouvier writes: > On 4/25/25 08:38, Markus Armbruster wrote: >> Pierrick Bouvier writes: >> >>> Note: This RFC was posted to trigger a discussion around this topic, and >>> it's >>> not expected to merge it as it is. >>> >>> Context >>> === >>> >>> Linaro is working towards hetero

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-25 Thread Markus Armbruster via Devel
Pierrick Bouvier writes: > Note: This RFC was posted to trigger a discussion around this topic, and it's > not expected to merge it as it is. > > Context > === > > Linaro is working towards heterogeneous emulation, mixing several > architectures > in a single QEMU process. The first prerequi