* [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 12:46 ` Manos Pitsidianakis
2026-01-05 4:33 ` Richard Henderson
2026-01-02 21:47 ` [PATCH v2 02/11] plugins: factorize plugin dependencies and library details Pierrick Bouvier
` (12 subsequent siblings)
13 siblings, 2 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
{contrib/plugins => plugins}/win32_linker.c | 0
contrib/plugins/meson.build | 2 +-
tests/tcg/plugins/meson.build | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename {contrib/plugins => plugins}/win32_linker.c (100%)
diff --git a/contrib/plugins/win32_linker.c b/plugins/win32_linker.c
similarity index 100%
rename from contrib/plugins/win32_linker.c
rename to plugins/win32_linker.c
diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
index eb944b5159a..6f72b2ce0c9 100644
--- a/contrib/plugins/meson.build
+++ b/contrib/plugins/meson.build
@@ -10,7 +10,7 @@ t = []
if get_option('plugins')
foreach i : contrib_plugins
if host_os == 'windows'
- t += shared_module(i, files(i + '.c') + 'win32_linker.c',
+ t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
include_directories: '../../include/qemu',
link_depends: [win32_qemu_plugin_api_lib],
link_args: win32_qemu_plugin_api_link_flags,
diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
index 561584159eb..a6e78438510 100644
--- a/tests/tcg/plugins/meson.build
+++ b/tests/tcg/plugins/meson.build
@@ -2,7 +2,7 @@ t = []
if get_option('plugins')
foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
if host_os == 'windows'
- t += shared_module(i, files(i + '.c') + '../../../contrib/plugins/win32_linker.c',
+ t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
include_directories: '../../../include/qemu',
link_depends: [win32_qemu_plugin_api_lib],
link_args: win32_qemu_plugin_api_link_flags,
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory
2026-01-02 21:47 ` [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
@ 2026-01-03 12:46 ` Manos Pitsidianakis
2026-01-05 4:33 ` Richard Henderson
1 sibling, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 12:46 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> {contrib/plugins => plugins}/win32_linker.c | 0
> contrib/plugins/meson.build | 2 +-
> tests/tcg/plugins/meson.build | 2 +-
> 3 files changed, 2 insertions(+), 2 deletions(-)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
>
>diff --git a/contrib/plugins/win32_linker.c b/plugins/win32_linker.c
>similarity index 100%
>rename from contrib/plugins/win32_linker.c
>rename to plugins/win32_linker.c
>diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>index eb944b5159a..6f72b2ce0c9 100644
>--- a/contrib/plugins/meson.build
>+++ b/contrib/plugins/meson.build
>@@ -10,7 +10,7 @@ t = []
> if get_option('plugins')
> foreach i : contrib_plugins
> if host_os == 'windows'
>- t += shared_module(i, files(i + '.c') + 'win32_linker.c',
>+ t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
> include_directories: '../../include/qemu',
> link_depends: [win32_qemu_plugin_api_lib],
> link_args: win32_qemu_plugin_api_link_flags,
>diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
>index 561584159eb..a6e78438510 100644
>--- a/tests/tcg/plugins/meson.build
>+++ b/tests/tcg/plugins/meson.build
>@@ -2,7 +2,7 @@ t = []
> if get_option('plugins')
> foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
> if host_os == 'windows'
>- t += shared_module(i, files(i + '.c') + '../../../contrib/plugins/win32_linker.c',
>+ t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
> include_directories: '../../../include/qemu',
> link_depends: [win32_qemu_plugin_api_lib],
> link_args: win32_qemu_plugin_api_link_flags,
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory
2026-01-02 21:47 ` [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
2026-01-03 12:46 ` Manos Pitsidianakis
@ 2026-01-05 4:33 ` Richard Henderson
1 sibling, 0 replies; 36+ messages in thread
From: Richard Henderson @ 2026-01-05 4:33 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé
On 1/3/26 08:47, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier<pierrick.bouvier@linaro.org>
> ---
> {contrib/plugins => plugins}/win32_linker.c | 0
> contrib/plugins/meson.build | 2 +-
> tests/tcg/plugins/meson.build | 2 +-
> 3 files changed, 2 insertions(+), 2 deletions(-)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 02/11] plugins: factorize plugin dependencies and library details
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
2026-01-02 21:47 ` [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-16 12:22 ` Daniel P. Berrangé
2026-01-02 21:47 ` [PATCH v2 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
` (11 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 2 +-
contrib/plugins/meson.build | 13 ++-----------
plugins/meson.build | 15 ++++++++++++++-
tests/tcg/plugins/meson.build | 13 ++-----------
4 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/meson.build b/meson.build
index db87358d62d..3d6c6c702d0 100644
--- a/meson.build
+++ b/meson.build
@@ -4499,7 +4499,7 @@ if get_option('plugins')
if host_os == 'windows'
# On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
# so that plugin authors can compile against it.
- install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
+ install_data(win32_qemu_plugin_api, install_dir: 'lib')
endif
endif
diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
index 6f72b2ce0c9..8f9f0257ee5 100644
--- a/contrib/plugins/meson.build
+++ b/contrib/plugins/meson.build
@@ -9,17 +9,8 @@ endif
t = []
if get_option('plugins')
foreach i : contrib_plugins
- if host_os == 'windows'
- t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
- include_directories: '../../include/qemu',
- link_depends: [win32_qemu_plugin_api_lib],
- link_args: win32_qemu_plugin_api_link_flags,
- dependencies: glib)
- else
- t += shared_module(i, files(i + '.c'),
- include_directories: '../../include/qemu',
- dependencies: glib)
- endif
+ t += shared_module(i, files(i + '.c'),
+ dependencies: plugins_deps)
endforeach
endif
if t.length() > 0
diff --git a/plugins/meson.build b/plugins/meson.build
index 62c991d87fc..4318e3a1671 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -51,11 +51,24 @@ if host_os == 'windows'
dlltool_cmd = [dlltool, '--input-def', '@INPUT@',
'--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe']
endif
- win32_qemu_plugin_api_lib = configure_file(
+ win32_qemu_plugin_api = configure_file(
input: win32_plugin_def,
output: 'libqemu_plugin_api.a',
command: dlltool_cmd
)
+ win32_qemu_plugin_api_lib = static_library('win32_qemu_plugin_api',
+ link_depends: win32_qemu_plugin_api)
+endif
+
+if host_os == 'windows'
+ plugins_deps = declare_dependency(sources: [files('win32_linker.c')],
+ include_directories: '../include/qemu',
+ link_with: win32_qemu_plugin_api_lib,
+ link_args: win32_qemu_plugin_api_link_flags,
+ dependencies: glib)
+else
+ plugins_deps = declare_dependency(include_directories: '../include/qemu',
+ dependencies: glib)
endif
user_ss.add(files('user.c', 'api-user.c'))
diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
index a6e78438510..c58f2e382ae 100644
--- a/tests/tcg/plugins/meson.build
+++ b/tests/tcg/plugins/meson.build
@@ -1,17 +1,8 @@
t = []
if get_option('plugins')
foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
- if host_os == 'windows'
- t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
- include_directories: '../../../include/qemu',
- link_depends: [win32_qemu_plugin_api_lib],
- link_args: win32_qemu_plugin_api_link_flags,
- dependencies: glib)
- else
- t += shared_module(i, files(i + '.c'),
- include_directories: '../../../include/qemu',
- dependencies: glib)
- endif
+ t += shared_module(i, files(i + '.c'),
+ dependencies: plugins_deps)
endforeach
endif
if t.length() > 0
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 02/11] plugins: factorize plugin dependencies and library details
2026-01-02 21:47 ` [PATCH v2 02/11] plugins: factorize plugin dependencies and library details Pierrick Bouvier
@ 2026-01-16 12:22 ` Daniel P. Berrangé
2026-01-17 0:02 ` Pierrick Bouvier
0 siblings, 1 reply; 36+ messages in thread
From: Daniel P. Berrangé @ 2026-01-16 12:22 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On Fri, Jan 02, 2026 at 01:47:15PM -0800, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> meson.build | 2 +-
> contrib/plugins/meson.build | 13 ++-----------
> plugins/meson.build | 15 ++++++++++++++-
> tests/tcg/plugins/meson.build | 13 ++-----------
> 4 files changed, 19 insertions(+), 24 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index db87358d62d..3d6c6c702d0 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -4499,7 +4499,7 @@ if get_option('plugins')
> if host_os == 'windows'
> # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
> # so that plugin authors can compile against it.
> - install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
> + install_data(win32_qemu_plugin_api, install_dir: 'lib')
> endif
> endif
>
> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
> index 6f72b2ce0c9..8f9f0257ee5 100644
> --- a/contrib/plugins/meson.build
> +++ b/contrib/plugins/meson.build
> @@ -9,17 +9,8 @@ endif
> t = []
> if get_option('plugins')
> foreach i : contrib_plugins
> - if host_os == 'windows'
> - t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
> - include_directories: '../../include/qemu',
> - link_depends: [win32_qemu_plugin_api_lib],
> - link_args: win32_qemu_plugin_api_link_flags,
> - dependencies: glib)
> - else
> - t += shared_module(i, files(i + '.c'),
> - include_directories: '../../include/qemu',
> - dependencies: glib)
> - endif
> + t += shared_module(i, files(i + '.c'),
> + dependencies: plugins_deps)
Nit-pick - under-indented by 1 space. The orignal code had the
same bug, but lets not preserve it.
> diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
> index a6e78438510..c58f2e382ae 100644
> --- a/tests/tcg/plugins/meson.build
> +++ b/tests/tcg/plugins/meson.build
> @@ -1,17 +1,8 @@
> t = []
> if get_option('plugins')
> foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
> - if host_os == 'windows'
> - t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
> - include_directories: '../../../include/qemu',
> - link_depends: [win32_qemu_plugin_api_lib],
> - link_args: win32_qemu_plugin_api_link_flags,
> - dependencies: glib)
> - else
> - t += shared_module(i, files(i + '.c'),
> - include_directories: '../../../include/qemu',
> - dependencies: glib)
> - endif
> + t += shared_module(i, files(i + '.c'),
> + dependencies: plugins_deps)
Same under-indent by 1.
With the indents fixed:
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 02/11] plugins: factorize plugin dependencies and library details
2026-01-16 12:22 ` Daniel P. Berrangé
@ 2026-01-17 0:02 ` Pierrick Bouvier
2026-01-19 8:09 ` Daniel P. Berrangé
0 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-17 0:02 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On 1/16/26 4:22 AM, Daniel P. Berrangé wrote:
> On Fri, Jan 02, 2026 at 01:47:15PM -0800, Pierrick Bouvier wrote:
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>> meson.build | 2 +-
>> contrib/plugins/meson.build | 13 ++-----------
>> plugins/meson.build | 15 ++++++++++++++-
>> tests/tcg/plugins/meson.build | 13 ++-----------
>> 4 files changed, 19 insertions(+), 24 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index db87358d62d..3d6c6c702d0 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -4499,7 +4499,7 @@ if get_option('plugins')
>> if host_os == 'windows'
>> # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
>> # so that plugin authors can compile against it.
>> - install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
>> + install_data(win32_qemu_plugin_api, install_dir: 'lib')
>> endif
>> endif
>>
>> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>> index 6f72b2ce0c9..8f9f0257ee5 100644
>> --- a/contrib/plugins/meson.build
>> +++ b/contrib/plugins/meson.build
>> @@ -9,17 +9,8 @@ endif
>> t = []
>> if get_option('plugins')
>> foreach i : contrib_plugins
>> - if host_os == 'windows'
>> - t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
>> - include_directories: '../../include/qemu',
>> - link_depends: [win32_qemu_plugin_api_lib],
>> - link_args: win32_qemu_plugin_api_link_flags,
>> - dependencies: glib)
>> - else
>> - t += shared_module(i, files(i + '.c'),
>> - include_directories: '../../include/qemu',
>> - dependencies: glib)
>> - endif
>> + t += shared_module(i, files(i + '.c'),
>> + dependencies: plugins_deps)
>
> Nit-pick - under-indented by 1 space. The orignal code had the
> same bug, but lets not preserve it.
>
>
>> diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
>> index a6e78438510..c58f2e382ae 100644
>> --- a/tests/tcg/plugins/meson.build
>> +++ b/tests/tcg/plugins/meson.build
>> @@ -1,17 +1,8 @@
>> t = []
>> if get_option('plugins')
>> foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
>> - if host_os == 'windows'
>> - t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
>> - include_directories: '../../../include/qemu',
>> - link_depends: [win32_qemu_plugin_api_lib],
>> - link_args: win32_qemu_plugin_api_link_flags,
>> - dependencies: glib)
>> - else
>> - t += shared_module(i, files(i + '.c'),
>> - include_directories: '../../../include/qemu',
>> - dependencies: glib)
>> - endif
>> + t += shared_module(i, files(i + '.c'),
>> + dependencies: plugins_deps)
>
> Same under-indent by 1.
>
> With the indents fixed:
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>
Patch 3 already fixes the indent.
>
>
> With regards,
> Daniel
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 02/11] plugins: factorize plugin dependencies and library details
2026-01-17 0:02 ` Pierrick Bouvier
@ 2026-01-19 8:09 ` Daniel P. Berrangé
2026-01-19 16:52 ` Pierrick Bouvier
0 siblings, 1 reply; 36+ messages in thread
From: Daniel P. Berrangé @ 2026-01-19 8:09 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On Fri, Jan 16, 2026 at 04:02:50PM -0800, Pierrick Bouvier wrote:
> On 1/16/26 4:22 AM, Daniel P. Berrangé wrote:
> > On Fri, Jan 02, 2026 at 01:47:15PM -0800, Pierrick Bouvier wrote:
> > > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> > > ---
> > > meson.build | 2 +-
> > > contrib/plugins/meson.build | 13 ++-----------
> > > plugins/meson.build | 15 ++++++++++++++-
> > > tests/tcg/plugins/meson.build | 13 ++-----------
> > > 4 files changed, 19 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/meson.build b/meson.build
> > > index db87358d62d..3d6c6c702d0 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -4499,7 +4499,7 @@ if get_option('plugins')
> > > if host_os == 'windows'
> > > # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
> > > # so that plugin authors can compile against it.
> > > - install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
> > > + install_data(win32_qemu_plugin_api, install_dir: 'lib')
> > > endif
> > > endif
> > > diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
> > > index 6f72b2ce0c9..8f9f0257ee5 100644
> > > --- a/contrib/plugins/meson.build
> > > +++ b/contrib/plugins/meson.build
> > > @@ -9,17 +9,8 @@ endif
> > > t = []
> > > if get_option('plugins')
> > > foreach i : contrib_plugins
> > > - if host_os == 'windows'
> > > - t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
> > > - include_directories: '../../include/qemu',
> > > - link_depends: [win32_qemu_plugin_api_lib],
> > > - link_args: win32_qemu_plugin_api_link_flags,
> > > - dependencies: glib)
> > > - else
> > > - t += shared_module(i, files(i + '.c'),
> > > - include_directories: '../../include/qemu',
> > > - dependencies: glib)
> > > - endif
> > > + t += shared_module(i, files(i + '.c'),
> > > + dependencies: plugins_deps)
> >
> > Nit-pick - under-indented by 1 space. The orignal code had the
> > same bug, but lets not preserve it.
> >
> >
> > > diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
> > > index a6e78438510..c58f2e382ae 100644
> > > --- a/tests/tcg/plugins/meson.build
> > > +++ b/tests/tcg/plugins/meson.build
> > > @@ -1,17 +1,8 @@
> > > t = []
> > > if get_option('plugins')
> > > foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
> > > - if host_os == 'windows'
> > > - t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
> > > - include_directories: '../../../include/qemu',
> > > - link_depends: [win32_qemu_plugin_api_lib],
> > > - link_args: win32_qemu_plugin_api_link_flags,
> > > - dependencies: glib)
> > > - else
> > > - t += shared_module(i, files(i + '.c'),
> > > - include_directories: '../../../include/qemu',
> > > - dependencies: glib)
> > > - endif
> > > + t += shared_module(i, files(i + '.c'),
> > > + dependencies: plugins_deps)
> >
> > Same under-indent by 1.
> >
> > With the indents fixed:
> >
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> >
>
> Patch 3 already fixes the indent.
Please fix the problem in this patch since that is where it is first
present in this series.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 02/11] plugins: factorize plugin dependencies and library details
2026-01-19 8:09 ` Daniel P. Berrangé
@ 2026-01-19 16:52 ` Pierrick Bouvier
0 siblings, 0 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-19 16:52 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On 1/19/26 12:09 AM, Daniel P. Berrangé wrote:
> On Fri, Jan 16, 2026 at 04:02:50PM -0800, Pierrick Bouvier wrote:
>> On 1/16/26 4:22 AM, Daniel P. Berrangé wrote:
>>> On Fri, Jan 02, 2026 at 01:47:15PM -0800, Pierrick Bouvier wrote:
>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>> ---
>>>> meson.build | 2 +-
>>>> contrib/plugins/meson.build | 13 ++-----------
>>>> plugins/meson.build | 15 ++++++++++++++-
>>>> tests/tcg/plugins/meson.build | 13 ++-----------
>>>> 4 files changed, 19 insertions(+), 24 deletions(-)
>>>>
>>>> diff --git a/meson.build b/meson.build
>>>> index db87358d62d..3d6c6c702d0 100644
>>>> --- a/meson.build
>>>> +++ b/meson.build
>>>> @@ -4499,7 +4499,7 @@ if get_option('plugins')
>>>> if host_os == 'windows'
>>>> # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
>>>> # so that plugin authors can compile against it.
>>>> - install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
>>>> + install_data(win32_qemu_plugin_api, install_dir: 'lib')
>>>> endif
>>>> endif
>>>> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>>>> index 6f72b2ce0c9..8f9f0257ee5 100644
>>>> --- a/contrib/plugins/meson.build
>>>> +++ b/contrib/plugins/meson.build
>>>> @@ -9,17 +9,8 @@ endif
>>>> t = []
>>>> if get_option('plugins')
>>>> foreach i : contrib_plugins
>>>> - if host_os == 'windows'
>>>> - t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
>>>> - include_directories: '../../include/qemu',
>>>> - link_depends: [win32_qemu_plugin_api_lib],
>>>> - link_args: win32_qemu_plugin_api_link_flags,
>>>> - dependencies: glib)
>>>> - else
>>>> - t += shared_module(i, files(i + '.c'),
>>>> - include_directories: '../../include/qemu',
>>>> - dependencies: glib)
>>>> - endif
>>>> + t += shared_module(i, files(i + '.c'),
>>>> + dependencies: plugins_deps)
>>>
>>> Nit-pick - under-indented by 1 space. The orignal code had the
>>> same bug, but lets not preserve it.
>>>
>>>
>>>> diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
>>>> index a6e78438510..c58f2e382ae 100644
>>>> --- a/tests/tcg/plugins/meson.build
>>>> +++ b/tests/tcg/plugins/meson.build
>>>> @@ -1,17 +1,8 @@
>>>> t = []
>>>> if get_option('plugins')
>>>> foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
>>>> - if host_os == 'windows'
>>>> - t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
>>>> - include_directories: '../../../include/qemu',
>>>> - link_depends: [win32_qemu_plugin_api_lib],
>>>> - link_args: win32_qemu_plugin_api_link_flags,
>>>> - dependencies: glib)
>>>> - else
>>>> - t += shared_module(i, files(i + '.c'),
>>>> - include_directories: '../../../include/qemu',
>>>> - dependencies: glib)
>>>> - endif
>>>> + t += shared_module(i, files(i + '.c'),
>>>> + dependencies: plugins_deps)
>>>
>>> Same under-indent by 1.
>>>
>>> With the indents fixed:
>>>
>>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>>>
>>
>> Patch 3 already fixes the indent.
>
> Please fix the problem in this patch since that is where it is first
> present in this series.
>
I will do that for next version, thanks.
> With regards,
> Daniel
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 03/11] plugins: use complete filename for defining plugins sources
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
2026-01-02 21:47 ` [PATCH v2 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
2026-01-02 21:47 ` [PATCH v2 02/11] plugins: factorize plugin dependencies and library details Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 12:47 ` Manos Pitsidianakis
2026-01-02 21:47 ` [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
` (10 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
contrib/plugins/meson.build | 12 ++++++------
tests/tcg/plugins/meson.build | 9 ++++++---
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
index 8f9f0257ee5..3d2d7862e0c 100644
--- a/contrib/plugins/meson.build
+++ b/contrib/plugins/meson.build
@@ -1,16 +1,16 @@
-contrib_plugins = ['bbv', 'cache', 'cflow', 'drcov', 'execlog', 'hotblocks',
- 'hotpages', 'howvec', 'hwprofile', 'ips', 'stoptrigger',
- 'traps', 'uftrace']
+contrib_plugins = ['bbv.c', 'cache.c', 'cflow.c', 'drcov.c', 'execlog.c',
+ 'hotblocks.c', 'hotpages.c', 'howvec.c', 'hwprofile.c',
+ 'ips.c', 'stoptrigger.c', 'traps.c', 'uftrace.c']
if host_os != 'windows'
# lockstep uses socket.h
- contrib_plugins += 'lockstep'
+ contrib_plugins += 'lockstep.c'
endif
t = []
if get_option('plugins')
foreach i : contrib_plugins
- t += shared_module(i, files(i + '.c'),
- dependencies: plugins_deps)
+ t += shared_module(fs.stem(i), files(i),
+ dependencies: plugins_deps)
endforeach
endif
if t.length() > 0
diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
index c58f2e382ae..303f97f9679 100644
--- a/tests/tcg/plugins/meson.build
+++ b/tests/tcg/plugins/meson.build
@@ -1,8 +1,11 @@
+test_plugins = ['bb.c', 'discons.c', 'empty.c', 'inline.c', 'insn.c', 'mem.c',
+ 'reset.c', 'syscall.c', 'patch.c']
+
t = []
if get_option('plugins')
- foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
- t += shared_module(i, files(i + '.c'),
- dependencies: plugins_deps)
+ foreach i : test_plugins
+ t += shared_module(fs.stem(i), files(i),
+ dependencies: plugins_deps)
endforeach
endif
if t.length() > 0
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 03/11] plugins: use complete filename for defining plugins sources
2026-01-02 21:47 ` [PATCH v2 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
@ 2026-01-03 12:47 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 12:47 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> contrib/plugins/meson.build | 12 ++++++------
> tests/tcg/plugins/meson.build | 9 ++++++---
> 2 files changed, 12 insertions(+), 9 deletions(-)
>
>diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>index 8f9f0257ee5..3d2d7862e0c 100644
>--- a/contrib/plugins/meson.build
>+++ b/contrib/plugins/meson.build
>@@ -1,16 +1,16 @@
>-contrib_plugins = ['bbv', 'cache', 'cflow', 'drcov', 'execlog', 'hotblocks',
>- 'hotpages', 'howvec', 'hwprofile', 'ips', 'stoptrigger',
>- 'traps', 'uftrace']
>+contrib_plugins = ['bbv.c', 'cache.c', 'cflow.c', 'drcov.c', 'execlog.c',
>+ 'hotblocks.c', 'hotpages.c', 'howvec.c', 'hwprofile.c',
>+ 'ips.c', 'stoptrigger.c', 'traps.c', 'uftrace.c']
> if host_os != 'windows'
> # lockstep uses socket.h
>- contrib_plugins += 'lockstep'
>+ contrib_plugins += 'lockstep.c'
> endif
>
> t = []
> if get_option('plugins')
> foreach i : contrib_plugins
>- t += shared_module(i, files(i + '.c'),
>- dependencies: plugins_deps)
>+ t += shared_module(fs.stem(i), files(i),
>+ dependencies: plugins_deps)
> endforeach
> endif
> if t.length() > 0
>diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build
>index c58f2e382ae..303f97f9679 100644
>--- a/tests/tcg/plugins/meson.build
>+++ b/tests/tcg/plugins/meson.build
>@@ -1,8 +1,11 @@
>+test_plugins = ['bb.c', 'discons.c', 'empty.c', 'inline.c', 'insn.c', 'mem.c',
>+ 'reset.c', 'syscall.c', 'patch.c']
>+
> t = []
> if get_option('plugins')
>- foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
>- t += shared_module(i, files(i + '.c'),
>- dependencies: plugins_deps)
>+ foreach i : test_plugins
>+ t += shared_module(fs.stem(i), files(i),
>+ dependencies: plugins_deps)
> endforeach
> endif
> if t.length() > 0
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (2 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-05 5:10 ` Richard Henderson
2026-01-18 18:30 ` Philippe Mathieu-Daudé
2026-01-02 21:47 ` [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers Pierrick Bouvier
` (9 subsequent siblings)
13 siblings, 2 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/qemu/qemu-plugin.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index 60de4fdd3fa..e44f863d839 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -16,6 +16,10 @@
#include <stdbool.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* For best performance, build the plugin with -fvisibility=hidden so that
* QEMU_PLUGIN_LOCAL is implicit. Then, just mark qemu_plugin_install with
@@ -1210,4 +1214,8 @@ void qemu_plugin_u64_set(qemu_plugin_u64 entry, unsigned int vcpu_index,
QEMU_PLUGIN_API
uint64_t qemu_plugin_u64_sum(qemu_plugin_u64 entry);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* QEMU_QEMU_PLUGIN_H */
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++
2026-01-02 21:47 ` [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
@ 2026-01-05 5:10 ` Richard Henderson
2026-01-18 18:30 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 36+ messages in thread
From: Richard Henderson @ 2026-01-05 5:10 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé
On 1/3/26 08:47, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> include/qemu/qemu-plugin.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
>
> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
> index 60de4fdd3fa..e44f863d839 100644
> --- a/include/qemu/qemu-plugin.h
> +++ b/include/qemu/qemu-plugin.h
> @@ -16,6 +16,10 @@
> #include <stdbool.h>
> #include <stddef.h>
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> /*
> * For best performance, build the plugin with -fvisibility=hidden so that
> * QEMU_PLUGIN_LOCAL is implicit. Then, just mark qemu_plugin_install with
> @@ -1210,4 +1214,8 @@ void qemu_plugin_u64_set(qemu_plugin_u64 entry, unsigned int vcpu_index,
> QEMU_PLUGIN_API
> uint64_t qemu_plugin_u64_sum(qemu_plugin_u64 entry);
>
> +#ifdef __cplusplus
> +} /* extern "C" */
> +#endif
> +
> #endif /* QEMU_QEMU_PLUGIN_H */
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++
2026-01-02 21:47 ` [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
2026-01-05 5:10 ` Richard Henderson
@ 2026-01-18 18:30 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-18 18:30 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Manos Pitsidianakis,
Alex Bennée, Paolo Bonzini, Daniel P . Berrangé
On 2/1/26 22:47, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> include/qemu/qemu-plugin.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (3 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 12:49 ` Manos Pitsidianakis
2026-01-18 18:30 ` Philippe Mathieu-Daudé
2026-01-02 21:47 ` [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/ Pierrick Bouvier
` (8 subsequent siblings)
13 siblings, 2 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
This plugin uses endianness conversion primitives from QEMU headers. As
next commit will strongly isolate plugins code from those headers, those
primitives can't be used anymore.
glib.h provides such primitives:
https://docs.gtk.org/glib/conversion-macros.html#byte-order-conversion
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
tests/tcg/plugins/mem.c | 59 ++++++++++++++++-------------------------
1 file changed, 23 insertions(+), 36 deletions(-)
diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c
index 9649bce99ca..7d64e7018f2 100644
--- a/tests/tcg/plugins/mem.c
+++ b/tests/tcg/plugins/mem.c
@@ -12,16 +12,7 @@
#include <stdio.h>
#include <glib.h>
-/*
- * plugins should not include anything from QEMU aside from the
- * API header. However as this is a test plugin to exercise the
- * internals of QEMU and we want to avoid needless code duplication we
- * do so here. bswap.h is pretty self-contained although it needs a
- * few things provided by compiler.h.
- */
-#include <compiler.h>
#include <stdbool.h>
-#include <bswap.h>
#include <qemu-plugin.h>
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
@@ -152,56 +143,52 @@ static void update_region_info(uint64_t region, uint64_t offset,
ri->reads++;
}
+ void *ri_data = &ri->data[offset];
switch (value.type) {
case QEMU_PLUGIN_MEM_VALUE_U8:
+ {
+ uint8_t val = value.data.u8;
+ uint8_t *p = ri_data;
if (is_store) {
- ri->data[offset] = value.data.u8;
- } else if (ri->data[offset] != value.data.u8) {
- unseen_data = true;
+ *p = val;
+ } else {
+ unseen_data = *p != val;
}
break;
+ }
case QEMU_PLUGIN_MEM_VALUE_U16:
{
- uint16_t *p = (uint16_t *) &ri->data[offset];
+ uint16_t val = be ? GUINT16_FROM_BE(value.data.u16) :
+ GUINT16_FROM_LE(value.data.u16);
+ uint16_t *p = ri_data;
if (is_store) {
- if (be) {
- stw_be_p(p, value.data.u16);
- } else {
- stw_le_p(p, value.data.u16);
- }
+ *p = val;
} else {
- uint16_t val = be ? lduw_be_p(p) : lduw_le_p(p);
- unseen_data = val != value.data.u16;
+ unseen_data = *p != val;
}
break;
}
case QEMU_PLUGIN_MEM_VALUE_U32:
{
- uint32_t *p = (uint32_t *) &ri->data[offset];
+ uint32_t val = be ? GUINT32_FROM_BE(value.data.u32) :
+ GUINT32_FROM_LE(value.data.u32);
+ uint32_t *p = ri_data;
if (is_store) {
- if (be) {
- stl_be_p(p, value.data.u32);
- } else {
- stl_le_p(p, value.data.u32);
- }
+ *p = val;
} else {
- uint32_t val = be ? ldl_be_p(p) : ldl_le_p(p);
- unseen_data = val != value.data.u32;
+ unseen_data = *p != val;
}
break;
}
case QEMU_PLUGIN_MEM_VALUE_U64:
{
- uint64_t *p = (uint64_t *) &ri->data[offset];
+ uint64_t val = be ? GUINT64_FROM_BE(value.data.u64) :
+ GUINT64_FROM_LE(value.data.u64);
+ uint64_t *p = ri_data;
if (is_store) {
- if (be) {
- stq_be_p(p, value.data.u64);
- } else {
- stq_le_p(p, value.data.u64);
- }
+ *p = val;
} else {
- uint64_t val = be ? ldq_be_p(p) : ldq_le_p(p);
- unseen_data = val != value.data.u64;
+ unseen_data = *p != val;
}
break;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers
2026-01-02 21:47 ` [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers Pierrick Bouvier
@ 2026-01-03 12:49 ` Manos Pitsidianakis
2026-01-18 18:30 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 12:49 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>This plugin uses endianness conversion primitives from QEMU headers. As
>next commit will strongly isolate plugins code from those headers, those
>primitives can't be used anymore.
>
>glib.h provides such primitives:
>https://docs.gtk.org/glib/conversion-macros.html#byte-order-conversion
>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> tests/tcg/plugins/mem.c | 59 ++++++++++++++++-------------------------
> 1 file changed, 23 insertions(+), 36 deletions(-)
>
>diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c
>index 9649bce99ca..7d64e7018f2 100644
>--- a/tests/tcg/plugins/mem.c
>+++ b/tests/tcg/plugins/mem.c
>@@ -12,16 +12,7 @@
> #include <stdio.h>
> #include <glib.h>
>
>-/*
>- * plugins should not include anything from QEMU aside from the
>- * API header. However as this is a test plugin to exercise the
>- * internals of QEMU and we want to avoid needless code duplication we
>- * do so here. bswap.h is pretty self-contained although it needs a
>- * few things provided by compiler.h.
>- */
>-#include <compiler.h>
> #include <stdbool.h>
>-#include <bswap.h>
> #include <qemu-plugin.h>
>
> QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
>@@ -152,56 +143,52 @@ static void update_region_info(uint64_t region, uint64_t offset,
> ri->reads++;
> }
>
>+ void *ri_data = &ri->data[offset];
> switch (value.type) {
> case QEMU_PLUGIN_MEM_VALUE_U8:
>+ {
>+ uint8_t val = value.data.u8;
>+ uint8_t *p = ri_data;
> if (is_store) {
>- ri->data[offset] = value.data.u8;
>- } else if (ri->data[offset] != value.data.u8) {
>- unseen_data = true;
>+ *p = val;
>+ } else {
>+ unseen_data = *p != val;
> }
> break;
>+ }
> case QEMU_PLUGIN_MEM_VALUE_U16:
> {
>- uint16_t *p = (uint16_t *) &ri->data[offset];
>+ uint16_t val = be ? GUINT16_FROM_BE(value.data.u16) :
>+ GUINT16_FROM_LE(value.data.u16);
>+ uint16_t *p = ri_data;
> if (is_store) {
>- if (be) {
>- stw_be_p(p, value.data.u16);
>- } else {
>- stw_le_p(p, value.data.u16);
>- }
>+ *p = val;
> } else {
>- uint16_t val = be ? lduw_be_p(p) : lduw_le_p(p);
>- unseen_data = val != value.data.u16;
>+ unseen_data = *p != val;
> }
> break;
> }
> case QEMU_PLUGIN_MEM_VALUE_U32:
> {
>- uint32_t *p = (uint32_t *) &ri->data[offset];
>+ uint32_t val = be ? GUINT32_FROM_BE(value.data.u32) :
>+ GUINT32_FROM_LE(value.data.u32);
>+ uint32_t *p = ri_data;
> if (is_store) {
>- if (be) {
>- stl_be_p(p, value.data.u32);
>- } else {
>- stl_le_p(p, value.data.u32);
>- }
>+ *p = val;
> } else {
>- uint32_t val = be ? ldl_be_p(p) : ldl_le_p(p);
>- unseen_data = val != value.data.u32;
>+ unseen_data = *p != val;
> }
> break;
> }
> case QEMU_PLUGIN_MEM_VALUE_U64:
> {
>- uint64_t *p = (uint64_t *) &ri->data[offset];
>+ uint64_t val = be ? GUINT64_FROM_BE(value.data.u64) :
>+ GUINT64_FROM_LE(value.data.u64);
>+ uint64_t *p = ri_data;
> if (is_store) {
>- if (be) {
>- stq_be_p(p, value.data.u64);
>- } else {
>- stq_le_p(p, value.data.u64);
>- }
>+ *p = val;
> } else {
>- uint64_t val = be ? ldq_be_p(p) : ldq_le_p(p);
>- unseen_data = val != value.data.u64;
>+ unseen_data = *p != val;
> }
> break;
> }
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers
2026-01-02 21:47 ` [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers Pierrick Bouvier
2026-01-03 12:49 ` Manos Pitsidianakis
@ 2026-01-18 18:30 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 36+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-01-18 18:30 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Manos Pitsidianakis,
Alex Bennée, Paolo Bonzini, Daniel P . Berrangé
On 2/1/26 22:47, Pierrick Bouvier wrote:
> This plugin uses endianness conversion primitives from QEMU headers. As
> next commit will strongly isolate plugins code from those headers, those
> primitives can't be used anymore.
\o/
> glib.h provides such primitives:
> https://docs.gtk.org/glib/conversion-macros.html#byte-order-conversion
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> tests/tcg/plugins/mem.c | 59 ++++++++++++++++-------------------------
> 1 file changed, 23 insertions(+), 36 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (4 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 05/11] tests/tcg/plugins/mem.c: remove dependency on qemu headers Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 12:53 ` Manos Pitsidianakis
2026-01-05 5:13 ` Richard Henderson
2026-01-02 21:47 ` [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
` (7 subsequent siblings)
13 siblings, 2 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
This change has two benefits:
- ensure plugins can't include anything else from QEMU than plugins API
- when compiling a C++ module, solves the header conflict with iostream
header that includes transitively the wrong ctype.h, which already
exists in include/qemu.
By Hyrum's law, there was already one usage of other headers with mem
plugin, which has been eliminated in previous commit.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
docs/devel/tcg-plugins.rst | 4 ++--
meson.build | 2 +-
include/{qemu => plugins}/qemu-plugin.h | 3 ---
include/qemu/plugin.h | 2 +-
plugins/core.c | 2 +-
plugins/meson.build | 6 +++---
scripts/clean-includes | 2 +-
7 files changed, 9 insertions(+), 12 deletions(-)
rename include/{qemu => plugins}/qemu-plugin.h (99%)
diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
index 9463692c411..f48c32bd844 100644
--- a/docs/devel/tcg-plugins.rst
+++ b/docs/devel/tcg-plugins.rst
@@ -166,7 +166,7 @@ Plugin API
==========
The following API is generated from the inline documentation in
-``include/qemu/qemu-plugin.h``. Please ensure any updates to the API
+``include/plugins/qemu-plugin.h``. Please ensure any updates to the API
include the full kernel-doc annotations.
-.. kernel-doc:: include/qemu/qemu-plugin.h
+.. kernel-doc:: include/plugins/qemu-plugin.h
diff --git a/meson.build b/meson.build
index 3d6c6c702d0..a8fd8e88225 100644
--- a/meson.build
+++ b/meson.build
@@ -4495,7 +4495,7 @@ endforeach
# Other build targets
if get_option('plugins')
- install_headers('include/qemu/qemu-plugin.h')
+ install_headers('include/plugins/qemu-plugin.h')
if host_os == 'windows'
# On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
# so that plugin authors can compile against it.
diff --git a/include/qemu/qemu-plugin.h b/include/plugins/qemu-plugin.h
similarity index 99%
rename from include/qemu/qemu-plugin.h
rename to include/plugins/qemu-plugin.h
index e44f863d839..78872716246 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/plugins/qemu-plugin.h
@@ -2,9 +2,6 @@
* Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
* Copyright (C) 2019, Linaro
*
- * License: GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
* SPDX-License-Identifier: GPL-2.0-or-later
*/
diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
index cea0a68858b..cdd4f68c0c1 100644
--- a/include/qemu/plugin.h
+++ b/include/qemu/plugin.h
@@ -8,7 +8,7 @@
#define QEMU_PLUGIN_H
#include "qemu/config-file.h"
-#include "qemu/qemu-plugin.h"
+#include "plugins/qemu-plugin.h"
#include "qemu/error-report.h"
#include "qemu/queue.h"
#include "qemu/option.h"
diff --git a/plugins/core.c b/plugins/core.c
index b4b783008f7..3f66533d749 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -15,7 +15,7 @@
#include "qemu/lockable.h"
#include "qemu/option.h"
#include "qemu/plugin.h"
-#include "qemu/qemu-plugin.h"
+#include "plugins/qemu-plugin.h"
#include "qemu/queue.h"
#include "qemu/rcu_queue.h"
#include "qemu/rcu.h"
diff --git a/plugins/meson.build b/plugins/meson.build
index 4318e3a1671..34643e2cea3 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -3,7 +3,7 @@ if not get_option('plugins')
endif
qemu_plugin_symbols = configure_file(
- input: files('../include/qemu/qemu-plugin.h'),
+ input: files('../include/plugins/qemu-plugin.h'),
output: 'qemu-plugin.symbols',
capture: true,
command: [files('../scripts/qemu-plugin-symbols.py'), '@INPUT@'])
@@ -62,12 +62,12 @@ endif
if host_os == 'windows'
plugins_deps = declare_dependency(sources: [files('win32_linker.c')],
- include_directories: '../include/qemu',
+ include_directories: '../include/plugins',
link_with: win32_qemu_plugin_api_lib,
link_args: win32_qemu_plugin_api_link_flags,
dependencies: glib)
else
- plugins_deps = declare_dependency(include_directories: '../include/qemu',
+ plugins_deps = declare_dependency(include_directories: '../include/plugins',
dependencies: glib)
endif
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 25dbf16c021..3fae8e00e67 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -128,7 +128,7 @@ for f in "$@"; do
;;
*include/qemu/osdep.h | \
*include/qemu/compiler.h | \
- *include/qemu/qemu-plugin.h | \
+ *include/plugins/qemu-plugin.h | \
*include/glib-compat.h | \
*include/system/os-posix.h | \
*include/system/os-win32.h | \
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/
2026-01-02 21:47 ` [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/ Pierrick Bouvier
@ 2026-01-03 12:53 ` Manos Pitsidianakis
2026-01-05 5:13 ` Richard Henderson
1 sibling, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 12:53 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>This change has two benefits:
>- ensure plugins can't include anything else from QEMU than plugins API
>- when compiling a C++ module, solves the header conflict with iostream
> header that includes transitively the wrong ctype.h, which already
> exists in include/qemu.
>
>By Hyrum's law, there was already one usage of other headers with mem
>plugin, which has been eliminated in previous commit.
>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> docs/devel/tcg-plugins.rst | 4 ++--
> meson.build | 2 +-
> include/{qemu => plugins}/qemu-plugin.h | 3 ---
> include/qemu/plugin.h | 2 +-
> plugins/core.c | 2 +-
> plugins/meson.build | 6 +++---
> scripts/clean-includes | 2 +-
> 7 files changed, 9 insertions(+), 12 deletions(-)
> rename include/{qemu => plugins}/qemu-plugin.h (99%)
>
>diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
>index 9463692c411..f48c32bd844 100644
>--- a/docs/devel/tcg-plugins.rst
>+++ b/docs/devel/tcg-plugins.rst
>@@ -166,7 +166,7 @@ Plugin API
> ==========
>
> The following API is generated from the inline documentation in
>-``include/qemu/qemu-plugin.h``. Please ensure any updates to the API
>+``include/plugins/qemu-plugin.h``. Please ensure any updates to the API
> include the full kernel-doc annotations.
>
>-.. kernel-doc:: include/qemu/qemu-plugin.h
>+.. kernel-doc:: include/plugins/qemu-plugin.h
>diff --git a/meson.build b/meson.build
>index 3d6c6c702d0..a8fd8e88225 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -4495,7 +4495,7 @@ endforeach
> # Other build targets
>
> if get_option('plugins')
>- install_headers('include/qemu/qemu-plugin.h')
>+ install_headers('include/plugins/qemu-plugin.h')
> if host_os == 'windows'
> # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
> # so that plugin authors can compile against it.
>diff --git a/include/qemu/qemu-plugin.h b/include/plugins/qemu-plugin.h
>similarity index 99%
>rename from include/qemu/qemu-plugin.h
>rename to include/plugins/qemu-plugin.h
>index e44f863d839..78872716246 100644
>--- a/include/qemu/qemu-plugin.h
>+++ b/include/plugins/qemu-plugin.h
>@@ -2,9 +2,6 @@
> * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
> * Copyright (C) 2019, Linaro
> *
>- * License: GNU GPL, version 2 or later.
>- * See the COPYING file in the top-level directory.
>- *
> * SPDX-License-Identifier: GPL-2.0-or-later
> */
>
>diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
>index cea0a68858b..cdd4f68c0c1 100644
>--- a/include/qemu/plugin.h
>+++ b/include/qemu/plugin.h
>@@ -8,7 +8,7 @@
> #define QEMU_PLUGIN_H
>
> #include "qemu/config-file.h"
>-#include "qemu/qemu-plugin.h"
>+#include "plugins/qemu-plugin.h"
> #include "qemu/error-report.h"
> #include "qemu/queue.h"
> #include "qemu/option.h"
>diff --git a/plugins/core.c b/plugins/core.c
>index b4b783008f7..3f66533d749 100644
>--- a/plugins/core.c
>+++ b/plugins/core.c
>@@ -15,7 +15,7 @@
> #include "qemu/lockable.h"
> #include "qemu/option.h"
> #include "qemu/plugin.h"
>-#include "qemu/qemu-plugin.h"
>+#include "plugins/qemu-plugin.h"
> #include "qemu/queue.h"
> #include "qemu/rcu_queue.h"
> #include "qemu/rcu.h"
>diff --git a/plugins/meson.build b/plugins/meson.build
>index 4318e3a1671..34643e2cea3 100644
>--- a/plugins/meson.build
>+++ b/plugins/meson.build
>@@ -3,7 +3,7 @@ if not get_option('plugins')
> endif
>
> qemu_plugin_symbols = configure_file(
>- input: files('../include/qemu/qemu-plugin.h'),
>+ input: files('../include/plugins/qemu-plugin.h'),
> output: 'qemu-plugin.symbols',
> capture: true,
> command: [files('../scripts/qemu-plugin-symbols.py'), '@INPUT@'])
>@@ -62,12 +62,12 @@ endif
>
> if host_os == 'windows'
> plugins_deps = declare_dependency(sources: [files('win32_linker.c')],
>- include_directories: '../include/qemu',
>+ include_directories: '../include/plugins',
> link_with: win32_qemu_plugin_api_lib,
> link_args: win32_qemu_plugin_api_link_flags,
> dependencies: glib)
> else
>- plugins_deps = declare_dependency(include_directories: '../include/qemu',
>+ plugins_deps = declare_dependency(include_directories: '../include/plugins',
> dependencies: glib)
> endif
>
>diff --git a/scripts/clean-includes b/scripts/clean-includes
>index 25dbf16c021..3fae8e00e67 100755
>--- a/scripts/clean-includes
>+++ b/scripts/clean-includes
>@@ -128,7 +128,7 @@ for f in "$@"; do
> ;;
> *include/qemu/osdep.h | \
> *include/qemu/compiler.h | \
>- *include/qemu/qemu-plugin.h | \
>+ *include/plugins/qemu-plugin.h | \
> *include/glib-compat.h | \
> *include/system/os-posix.h | \
> *include/system/os-win32.h | \
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/
2026-01-02 21:47 ` [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/ Pierrick Bouvier
2026-01-03 12:53 ` Manos Pitsidianakis
@ 2026-01-05 5:13 ` Richard Henderson
1 sibling, 0 replies; 36+ messages in thread
From: Richard Henderson @ 2026-01-05 5:13 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé
On 1/3/26 08:47, Pierrick Bouvier wrote:
> This change has two benefits:
> - ensure plugins can't include anything else from QEMU than plugins API
> - when compiling a C++ module, solves the header conflict with iostream
> header that includes transitively the wrong ctype.h, which already
> exists in include/qemu.
>
> By Hyrum's law, there was already one usage of other headers with mem
> plugin, which has been eliminated in previous commit.
>
> Signed-off-by: Pierrick Bouvier<pierrick.bouvier@linaro.org>
> ---
> docs/devel/tcg-plugins.rst | 4 ++--
> meson.build | 2 +-
> include/{qemu => plugins}/qemu-plugin.h | 3 ---
> include/qemu/plugin.h | 2 +-
> plugins/core.c | 2 +-
> plugins/meson.build | 6 +++---
> scripts/clean-includes | 2 +-
> 7 files changed, 9 insertions(+), 12 deletions(-)
> rename include/{qemu => plugins}/qemu-plugin.h (99%)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (5 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 06/11] plugins: move qemu-plugin.h to include/plugins/ Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 12:54 ` Manos Pitsidianakis
2026-01-02 21:47 ` [PATCH v2 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
` (6 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
qemu_common_flags are only checked for c compiler, even though they
are applied to c++ and objc. This is a problem when C compiler is gcc,
and C++ compiler is clang, creating a possible mismatch.
One concrete example is option -fzero-call-used-regs=used-gpr with
ubuntu2204 container, which is supported by gcc, but not by clang, thus
leading to a failure when compiling a C++ TCG plugin.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index a8fd8e88225..256cc0cdb21 100644
--- a/meson.build
+++ b/meson.build
@@ -709,10 +709,7 @@ if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }'
hardening_flags += '-fzero-call-used-regs=used-gpr'
endif
-qemu_common_flags += cc.get_supported_arguments(hardening_flags)
-
-add_global_arguments(qemu_common_flags, native: false, language: all_languages)
-add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
+qemu_common_flags += hardening_flags
# Collect warning flags we want to set, sorted alphabetically
warn_flags = [
@@ -771,15 +768,19 @@ if 'cpp' in all_languages
qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + qemu_cflags
endif
-add_project_arguments(qemu_cflags, native: false, language: 'c')
-add_project_arguments(cc.get_supported_arguments(warn_flags), native: false, language: 'c')
+add_project_arguments(cc.get_supported_arguments(qemu_common_flags + qemu_cflags + warn_flags),
+ native: false, language: 'c')
+add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
+
if 'cpp' in all_languages
- add_project_arguments(qemu_cxxflags, native: false, language: 'cpp')
+ add_project_arguments(cxx.get_supported_arguments(qemu_common_flags + qemu_cxxflags),
+ native: false, language: 'cpp')
add_project_arguments(cxx.get_supported_arguments(warn_flags), native: false, language: 'cpp')
endif
if 'objc' in all_languages
# Note sanitizer flags are not applied to Objective-C sources!
- add_project_arguments(objc.get_supported_arguments(warn_flags), native: false, language: 'objc')
+ add_project_arguments(objc.get_supported_arguments(qemu_common_flags + warn_flags),
+ native: false, language: 'objc')
endif
if host_os == 'linux'
add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C
2026-01-02 21:47 ` [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
@ 2026-01-03 12:54 ` Manos Pitsidianakis
2026-01-03 20:39 ` Pierrick Bouvier
0 siblings, 1 reply; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 12:54 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>qemu_common_flags are only checked for c compiler, even though they
>are applied to c++ and objc. This is a problem when C compiler is gcc,
>and C++ compiler is clang, creating a possible mismatch.
>
>One concrete example is option -fzero-call-used-regs=used-gpr with
>ubuntu2204 container, which is supported by gcc, but not by clang, thus
>leading to a failure when compiling a C++ TCG plugin.
>
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
> meson.build | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
>diff --git a/meson.build b/meson.build
>index a8fd8e88225..256cc0cdb21 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -709,10 +709,7 @@ if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }'
> hardening_flags += '-fzero-call-used-regs=used-gpr'
> endif
>
>-qemu_common_flags += cc.get_supported_arguments(hardening_flags)
>-
>-add_global_arguments(qemu_common_flags, native: false, language: all_languages)
>-add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
>+qemu_common_flags += hardening_flags
>
> # Collect warning flags we want to set, sorted alphabetically
> warn_flags = [
>@@ -771,15 +768,19 @@ if 'cpp' in all_languages
> qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + qemu_cflags
> endif
>
>-add_project_arguments(qemu_cflags, native: false, language: 'c')
>-add_project_arguments(cc.get_supported_arguments(warn_flags), native: false, language: 'c')
>+add_project_arguments(cc.get_supported_arguments(qemu_common_flags + qemu_cflags + warn_flags),
>+ native: false, language: 'c')
>+add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
>+
> if 'cpp' in all_languages
>- add_project_arguments(qemu_cxxflags, native: false, language: 'cpp')
>+ add_project_arguments(cxx.get_supported_arguments(qemu_common_flags + qemu_cxxflags),
>+ native: false, language: 'cpp')
This is a subtle behavior change (qemu_cxxflags wasn't filtered through
cxx.get_supported_arguments previously). Do we care about this?
> add_project_arguments(cxx.get_supported_arguments(warn_flags), native: false, language: 'cpp')
> endif
> if 'objc' in all_languages
> # Note sanitizer flags are not applied to Objective-C sources!
>- add_project_arguments(objc.get_supported_arguments(warn_flags), native: false, language: 'objc')
>+ add_project_arguments(objc.get_supported_arguments(qemu_common_flags + warn_flags),
>+ native: false, language: 'objc')
> endif
> if host_os == 'linux'
> add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C
2026-01-03 12:54 ` Manos Pitsidianakis
@ 2026-01-03 20:39 ` Pierrick Bouvier
2026-01-04 10:03 ` Manos Pitsidianakis
0 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-03 20:39 UTC (permalink / raw)
To: Manos Pitsidianakis, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daud é,
Alex Benn é e, Paolo Bonzini, Daniel P.Berrang é
On 1/3/26 4:54 AM, Manos Pitsidianakis wrote:
> On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>> qemu_common_flags are only checked for c compiler, even though they
>> are applied to c++ and objc. This is a problem when C compiler is gcc,
>> and C++ compiler is clang, creating a possible mismatch.
>>
>> One concrete example is option -fzero-call-used-regs=used-gpr with
>> ubuntu2204 container, which is supported by gcc, but not by clang, thus
>> leading to a failure when compiling a C++ TCG plugin.
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>> meson.build | 17 +++++++++--------
>> 1 file changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index a8fd8e88225..256cc0cdb21 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -709,10 +709,7 @@ if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }'
>> hardening_flags += '-fzero-call-used-regs=used-gpr'
>> endif
>>
>> -qemu_common_flags += cc.get_supported_arguments(hardening_flags)
>> -
>> -add_global_arguments(qemu_common_flags, native: false, language: all_languages)
>> -add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
>> +qemu_common_flags += hardening_flags
>>
>> # Collect warning flags we want to set, sorted alphabetically
>> warn_flags = [
>> @@ -771,15 +768,19 @@ if 'cpp' in all_languages
>> qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + qemu_cflags
>> endif
>>
>> -add_project_arguments(qemu_cflags, native: false, language: 'c')
>> -add_project_arguments(cc.get_supported_arguments(warn_flags), native: false, language: 'c')
>> +add_project_arguments(cc.get_supported_arguments(qemu_common_flags + qemu_cflags + warn_flags),
>> + native: false, language: 'c')
>> +add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
>> +
>> if 'cpp' in all_languages
>> - add_project_arguments(qemu_cxxflags, native: false, language: 'cpp')
>> + add_project_arguments(cxx.get_supported_arguments(qemu_common_flags + qemu_cxxflags),
>> + native: false, language: 'cpp')
>
> This is a subtle behavior change (qemu_cxxflags wasn't filtered through
> cxx.get_supported_arguments previously). Do we care about this?
>
Sames goes for qemu_c_flags that we now filter also and we applied
directly before. The goal is to have the same code layout in meson.build
between the three languages for code clarity.
My argument for this and qemu_cxxflags is that it should be equivalent,
and if it's not, it should have been raised previously with an
unsupported argument warning at compile time anyway.
By curiousity, looking at meson source, has_argument is implemented by
compiling a file with the given flag, which is equivalent to what we do
manually. It has different implementations per language: grep
has_multi_arguments.
Thanks,
Pierrick
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C
2026-01-03 20:39 ` Pierrick Bouvier
@ 2026-01-04 10:03 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-04 10:03 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daud é, Alex Benn é e, Paolo Bonzini,
Daniel P.Berrang é
On Sat, Jan 3, 2026 at 10:39 PM Pierrick Bouvier
<pierrick.bouvier@linaro.org> wrote:
>
> On 1/3/26 4:54 AM, Manos Pitsidianakis wrote:
> > On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
> >> qemu_common_flags are only checked for c compiler, even though they
> >> are applied to c++ and objc. This is a problem when C compiler is gcc,
> >> and C++ compiler is clang, creating a possible mismatch.
> >>
> >> One concrete example is option -fzero-call-used-regs=used-gpr with
> >> ubuntu2204 container, which is supported by gcc, but not by clang, thus
> >> leading to a failure when compiling a C++ TCG plugin.
> >>
> >> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> >> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> >> ---
> >> meson.build | 17 +++++++++--------
> >> 1 file changed, 9 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/meson.build b/meson.build
> >> index a8fd8e88225..256cc0cdb21 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -709,10 +709,7 @@ if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }'
> >> hardening_flags += '-fzero-call-used-regs=used-gpr'
> >> endif
> >>
> >> -qemu_common_flags += cc.get_supported_arguments(hardening_flags)
> >> -
> >> -add_global_arguments(qemu_common_flags, native: false, language: all_languages)
> >> -add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
> >> +qemu_common_flags += hardening_flags
> >>
> >> # Collect warning flags we want to set, sorted alphabetically
> >> warn_flags = [
> >> @@ -771,15 +768,19 @@ if 'cpp' in all_languages
> >> qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + qemu_cflags
> >> endif
> >>
> >> -add_project_arguments(qemu_cflags, native: false, language: 'c')
> >> -add_project_arguments(cc.get_supported_arguments(warn_flags), native: false, language: 'c')
> >> +add_project_arguments(cc.get_supported_arguments(qemu_common_flags + qemu_cflags + warn_flags),
> >> + native: false, language: 'c')
> >> +add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
> >> +
> >> if 'cpp' in all_languages
> >> - add_project_arguments(qemu_cxxflags, native: false, language: 'cpp')
> >> + add_project_arguments(cxx.get_supported_arguments(qemu_common_flags + qemu_cxxflags),
> >> + native: false, language: 'cpp')
> >
> > This is a subtle behavior change (qemu_cxxflags wasn't filtered through
> > cxx.get_supported_arguments previously). Do we care about this?
> >
>
> Sames goes for qemu_c_flags that we now filter also and we applied
> directly before. The goal is to have the same code layout in meson.build
> between the three languages for code clarity.
> My argument for this and qemu_cxxflags is that it should be equivalent,
> and if it's not, it should have been raised previously with an
> unsupported argument warning at compile time anyway.
>
> By curiousity, looking at meson source, has_argument is implemented by
> compiling a file with the given flag, which is equivalent to what we do
> manually. It has different implementations per language: grep
> has_multi_arguments.
>
> Thanks,
> Pierrick
Good enough for me
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 08/11] meson: enable cpp (optionally) for plugins
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (6 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 13:02 ` Manos Pitsidianakis
2026-01-02 21:47 ` [PATCH v2 09/11] qga/vss-win32: fix clang warning with C++20 Pierrick Bouvier
` (5 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 256cc0cdb21..38767c2c68a 100644
--- a/meson.build
+++ b/meson.build
@@ -77,7 +77,8 @@ python = import('python').find_installation()
cc = meson.get_compiler('c')
all_languages = ['c']
-if host_os == 'windows' and add_languages('cpp', required: false, native: false)
+enable_cpp = host_os == 'windows' or get_option('plugins')
+if enable_cpp and add_languages('cpp', required: false, native: false)
all_languages += ['cpp']
cxx = meson.get_compiler('cpp')
endif
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 08/11] meson: enable cpp (optionally) for plugins
2026-01-02 21:47 ` [PATCH v2 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
@ 2026-01-03 13:02 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 13:02 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/meson.build b/meson.build
>index 256cc0cdb21..38767c2c68a 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -77,7 +77,8 @@ python = import('python').find_installation()
>
> cc = meson.get_compiler('c')
> all_languages = ['c']
>-if host_os == 'windows' and add_languages('cpp', required: false, native: false)
>+enable_cpp = host_os == 'windows' or get_option('plugins')
>+if enable_cpp and add_languages('cpp', required: false, native: false)
> all_languages += ['cpp']
> cxx = meson.get_compiler('cpp')
> endif
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 09/11] qga/vss-win32: fix clang warning with C++20
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (7 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 13:03 ` Manos Pitsidianakis
2026-01-02 21:47 ` [PATCH v2 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
` (4 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
C++20 deprecated such constructs.
../qga/vss-win32/requester.cpp:380:32: error: bitwise operation between different enumeration types ('_VSS_SNAPSHOT_CONTEXT' and '_VSS_VOLUME_SNAPSHOT_ATTRIBUTES') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion]
380 | ctx = VSS_CTX_APP_ROLLBACK | VSS_VOLSNAP_ATTR_TRANSPORTABLE |
This is a false positive, since VSS_CTX_APP_ROLLBACK is not a value
defined in _VSS_VOLUME_SNAPSHOT_ATTRIBUTES enum.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
qga/vss-win32/requester.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 5615955b6f3..74489fcd0ae 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -377,8 +377,10 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
* To prevent the final commit (which requires to write to snapshots),
* ATTR_NO_AUTORECOVERY and ATTR_TRANSPORTABLE are specified here.
*/
- ctx = VSS_CTX_APP_ROLLBACK | VSS_VOLSNAP_ATTR_TRANSPORTABLE |
- VSS_VOLSNAP_ATTR_NO_AUTORECOVERY | VSS_VOLSNAP_ATTR_TXF_RECOVERY;
+ ctx = VSS_CTX_APP_ROLLBACK;
+ ctx |= VSS_VOLSNAP_ATTR_TRANSPORTABLE |
+ VSS_VOLSNAP_ATTR_NO_AUTORECOVERY |
+ VSS_VOLSNAP_ATTR_TXF_RECOVERY;
hr = vss_ctx.pVssbc->SetContext(ctx);
if (hr == (HRESULT)VSS_E_UNSUPPORTED_CONTEXT) {
/* Non-server version of Windows doesn't support ATTR_TRANSPORTABLE */
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 09/11] qga/vss-win32: fix clang warning with C++20
2026-01-02 21:47 ` [PATCH v2 09/11] qga/vss-win32: fix clang warning with C++20 Pierrick Bouvier
@ 2026-01-03 13:03 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 13:03 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>C++20 deprecated such constructs.
>
>../qga/vss-win32/requester.cpp:380:32: error: bitwise operation between different enumeration types ('_VSS_SNAPSHOT_CONTEXT' and '_VSS_VOLUME_SNAPSHOT_ATTRIBUTES') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion]
> 380 | ctx = VSS_CTX_APP_ROLLBACK | VSS_VOLSNAP_ATTR_TRANSPORTABLE |
>
>This is a false positive, since VSS_CTX_APP_ROLLBACK is not a value
>defined in _VSS_VOLUME_SNAPSHOT_ATTRIBUTES enum.
>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> qga/vss-win32/requester.cpp | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
>index 5615955b6f3..74489fcd0ae 100644
>--- a/qga/vss-win32/requester.cpp
>+++ b/qga/vss-win32/requester.cpp
>@@ -377,8 +377,10 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
> * To prevent the final commit (which requires to write to snapshots),
> * ATTR_NO_AUTORECOVERY and ATTR_TRANSPORTABLE are specified here.
> */
>- ctx = VSS_CTX_APP_ROLLBACK | VSS_VOLSNAP_ATTR_TRANSPORTABLE |
>- VSS_VOLSNAP_ATTR_NO_AUTORECOVERY | VSS_VOLSNAP_ATTR_TXF_RECOVERY;
>+ ctx = VSS_CTX_APP_ROLLBACK;
>+ ctx |= VSS_VOLSNAP_ATTR_TRANSPORTABLE |
>+ VSS_VOLSNAP_ATTR_NO_AUTORECOVERY |
>+ VSS_VOLSNAP_ATTR_TXF_RECOVERY;
> hr = vss_ctx.pVssbc->SetContext(ctx);
> if (hr == (HRESULT)VSS_E_UNSUPPORTED_CONTEXT) {
> /* Non-server version of Windows doesn't support ATTR_TRANSPORTABLE */
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 10/11] meson: update C++ standard to C++23
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (8 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 09/11] qga/vss-win32: fix clang warning with C++20 Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 13:04 ` Manos Pitsidianakis
2026-01-02 21:47 ` [PATCH v2 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
` (3 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
C++ is evolving faster than C, so it's useful to enable new standards,
especially for standard library.
Update to most recent standard available in our build environments.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 38767c2c68a..564cdde9153 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('qemu', ['c'], meson_version: '>=1.5.0',
- default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
+ default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++23', 'b_colorout=auto',
'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true',
'rust_std=2021', 'build.rust_std=2021'],
version: files('VERSION'))
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 10/11] meson: update C++ standard to C++23
2026-01-02 21:47 ` [PATCH v2 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
@ 2026-01-03 13:04 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 13:04 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>C++ is evolving faster than C, so it's useful to enable new standards,
>especially for standard library.
>Update to most recent standard available in our build environments.
>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> meson.build | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/meson.build b/meson.build
>index 38767c2c68a..564cdde9153 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -1,5 +1,5 @@
> project('qemu', ['c'], meson_version: '>=1.5.0',
>- default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
>+ default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++23', 'b_colorout=auto',
> 'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true',
> 'rust_std=2021', 'build.rust_std=2021'],
> version: files('VERSION'))
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* [PATCH v2 11/11] contrib/plugins: add empty cpp plugin
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (9 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
@ 2026-01-02 21:47 ` Pierrick Bouvier
2026-01-03 13:05 ` Manos Pitsidianakis
2026-01-15 20:53 ` [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (2 subsequent siblings)
13 siblings, 1 reply; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé, Pierrick Bouvier
This plugin makes sure we can compile in C++ while including qemu-plugin
header. It includes all C++ standard headers, up to C++23 standard,
minus the ones that are missing in the oldest environments we need to
build for.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++++++++++++++++++
contrib/plugins/meson.build | 4 ++
2 files changed, 123 insertions(+)
create mode 100644 contrib/plugins/cpp.cpp
diff --git a/contrib/plugins/cpp.cpp b/contrib/plugins/cpp.cpp
new file mode 100644
index 00000000000..1ff54896d97
--- /dev/null
+++ b/contrib/plugins/cpp.cpp
@@ -0,0 +1,119 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This C++ plugin ensures we don't have regression when compiling C++.
+ */
+
+#include <qemu-plugin.h>
+
+/* https://en.cppreference.com/w/cpp/headers.html */
+#include <algorithm>
+#include <any>
+#include <array>
+#include <atomic>
+#include <barrier>
+#include <bit>
+#include <bitset>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfenv>
+#include <cfloat>
+#include <charconv>
+#include <chrono>
+#include <cinttypes>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <codecvt>
+#include <compare>
+#include <complex>
+#include <concepts>
+#include <condition_variable>
+#include <coroutine>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <cuchar>
+#include <cwchar>
+#include <cwctype>
+#include <deque>
+#include <exception>
+#include <execution>
+#include <filesystem>
+#include <forward_list>
+#include <fstream>
+#include <functional>
+#include <future>
+#include <initializer_list>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <latch>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <memory_resource>
+#include <mutex>
+#include <new>
+#include <numbers>
+#include <numeric>
+#include <optional>
+#include <ostream>
+#include <queue>
+#include <random>
+#include <ranges>
+#include <ratio>
+#include <regex>
+#include <scoped_allocator>
+#include <semaphore>
+#include <set>
+#include <shared_mutex>
+#include <source_location>
+#include <span>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <stop_token>
+#include <streambuf>
+#include <string>
+#include <string_view>
+#include <syncstream>
+#include <system_error>
+#include <thread>
+#include <tuple>
+#include <typeindex>
+#include <typeinfo>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <valarray>
+#include <variant>
+#include <vector>
+#include <version>
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
+
+static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
+{
+}
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
+ const qemu_info_t *info,
+ int argc, char **argv)
+{
+ qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
+ return 0;
+}
diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
index 3d2d7862e0c..53d52c97967 100644
--- a/contrib/plugins/meson.build
+++ b/contrib/plugins/meson.build
@@ -6,6 +6,10 @@ if host_os != 'windows'
contrib_plugins += 'lockstep.c'
endif
+if 'cpp' in all_languages
+ contrib_plugins += 'cpp.cpp'
+endif
+
t = []
if get_option('plugins')
foreach i : contrib_plugins
--
2.47.3
^ permalink raw reply related [flat|nested] 36+ messages in thread* Re: [PATCH v2 11/11] contrib/plugins: add empty cpp plugin
2026-01-02 21:47 ` [PATCH v2 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
@ 2026-01-03 13:05 ` Manos Pitsidianakis
0 siblings, 0 replies; 36+ messages in thread
From: Manos Pitsidianakis @ 2026-01-03 13:05 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé ,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé , Pierrick Bouvier
On Fri, 02 Jan 2026 23:47, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
>This plugin makes sure we can compile in C++ while including qemu-plugin
>header. It includes all C++ standard headers, up to C++23 standard,
>minus the ones that are missing in the oldest environments we need to
>build for.
>
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++++++++++++++++++
> contrib/plugins/meson.build | 4 ++
> 2 files changed, 123 insertions(+)
> create mode 100644 contrib/plugins/cpp.cpp
>
>diff --git a/contrib/plugins/cpp.cpp b/contrib/plugins/cpp.cpp
>new file mode 100644
>index 00000000000..1ff54896d97
>--- /dev/null
>+++ b/contrib/plugins/cpp.cpp
>@@ -0,0 +1,119 @@
>+/*
>+ * SPDX-License-Identifier: GPL-2.0-or-later
>+ *
>+ * This C++ plugin ensures we don't have regression when compiling C++.
>+ */
>+
>+#include <qemu-plugin.h>
>+
>+/* https://en.cppreference.com/w/cpp/headers.html */
>+#include <algorithm>
>+#include <any>
>+#include <array>
>+#include <atomic>
>+#include <barrier>
>+#include <bit>
>+#include <bitset>
>+#include <cassert>
>+#include <cctype>
>+#include <cerrno>
>+#include <cfenv>
>+#include <cfloat>
>+#include <charconv>
>+#include <chrono>
>+#include <cinttypes>
>+#include <climits>
>+#include <clocale>
>+#include <cmath>
>+#include <codecvt>
>+#include <compare>
>+#include <complex>
>+#include <concepts>
>+#include <condition_variable>
>+#include <coroutine>
>+#include <csetjmp>
>+#include <csignal>
>+#include <cstdarg>
>+#include <cstddef>
>+#include <cstdint>
>+#include <cstdio>
>+#include <cstdlib>
>+#include <cstring>
>+#include <ctime>
>+#include <cuchar>
>+#include <cwchar>
>+#include <cwctype>
>+#include <deque>
>+#include <exception>
>+#include <execution>
>+#include <filesystem>
>+#include <forward_list>
>+#include <fstream>
>+#include <functional>
>+#include <future>
>+#include <initializer_list>
>+#include <iomanip>
>+#include <ios>
>+#include <iosfwd>
>+#include <iostream>
>+#include <istream>
>+#include <iterator>
>+#include <latch>
>+#include <limits>
>+#include <list>
>+#include <locale>
>+#include <map>
>+#include <memory>
>+#include <memory_resource>
>+#include <mutex>
>+#include <new>
>+#include <numbers>
>+#include <numeric>
>+#include <optional>
>+#include <ostream>
>+#include <queue>
>+#include <random>
>+#include <ranges>
>+#include <ratio>
>+#include <regex>
>+#include <scoped_allocator>
>+#include <semaphore>
>+#include <set>
>+#include <shared_mutex>
>+#include <source_location>
>+#include <span>
>+#include <sstream>
>+#include <stack>
>+#include <stdexcept>
>+#include <stop_token>
>+#include <streambuf>
>+#include <string>
>+#include <string_view>
>+#include <syncstream>
>+#include <system_error>
>+#include <thread>
>+#include <tuple>
>+#include <typeindex>
>+#include <typeinfo>
>+#include <type_traits>
>+#include <unordered_map>
>+#include <unordered_set>
>+#include <utility>
>+#include <valarray>
>+#include <variant>
>+#include <vector>
>+#include <version>
>+
>+QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
>+
>+static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
>+{
>+}
>+
>+QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
>+ const qemu_info_t *info,
>+ int argc, char **argv)
>+{
>+ qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
>+ return 0;
>+}
>diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>index 3d2d7862e0c..53d52c97967 100644
>--- a/contrib/plugins/meson.build
>+++ b/contrib/plugins/meson.build
>@@ -6,6 +6,10 @@ if host_os != 'windows'
> contrib_plugins += 'lockstep.c'
> endif
>
>+if 'cpp' in all_languages
>+ contrib_plugins += 'cpp.cpp'
>+endif
>+
> t = []
> if get_option('plugins')
> foreach i : contrib_plugins
>--
>2.47.3
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH v2 00/11] plugins: enable C++ plugins
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (10 preceding siblings ...)
2026-01-02 21:47 ` [PATCH v2 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
@ 2026-01-15 20:53 ` Pierrick Bouvier
2026-01-16 12:35 ` Daniel P. Berrangé
2026-01-19 19:13 ` Pierrick Bouvier
13 siblings, 0 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-15 20:53 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé
On 1/2/26 1:47 PM, Pierrick Bouvier wrote:
> Writing plugins in C can be sometimes tedious, especially when using Glib to
> keep track of execution state. We can directly use the same C API but write our
> plugin in C++, benefiting from its great standard library offering strings,
> smart pointers, data structures and synchronization mechanisms.
>
> It's common for downstream QEMU forks to provide C++ for plugins, like this:
> - https://github.com/panda-re/panda/tree/dev/panda/plugins
> - https://github.com/FlorentRevest/DejaView/tree/main/src/qemu_plugin
>
> Hopefully this will help more people to use upstream QEMU, and as a benefit, get
> their contribution back and help to develop plugins ecosystem upstream directly.
>
> This series first cleans up build system for plugins, factorizing details
> between contrib/plugins and tests/tcg/plugins folders.
> Then, we perform codebase cleanups to fix conflicts between existing headers
> and C++ headers.
> After that, we can update the C++ standard used by QEMU, to benefit fully
> from latest updates of the language.
> Finally, we define an empty C++ plugin, making sure we can keep track of
> possible regression in qemu-plugin header.
>
> Note: This series is *not* a trojan horse to bring C++ in QEMU
> codebase, nor to define an alternative C++ API for plugins. It's just enabling
> more users to get the most out of existing C plugin API.
>
> CI: https://gitlab.com/pbo-linaro/qemu/-/pipelines/2242427013
>
> v2
> --
>
> - drop coroutine.h rename patch as it's not needed
> - drop ctype.h rename patch, and move qemu-plugin.h to include/plugins
> - fix mem.c to not depend on other QEMU headers
>
> Pierrick Bouvier (11):
> plugins: move win32_linker.c file to plugins directory
> plugins: factorize plugin dependencies and library details
> plugins: use complete filename for defining plugins sources
> plugins: define plugin API symbols as extern "C" when compiling in C++
> tests/tcg/plugins/mem.c: remove dependency on qemu headers
> plugins: move qemu-plugin.h to include/plugins/
> meson: fix supported compiler arguments in other languages than C
> meson: enable cpp (optionally) for plugins
> qga/vss-win32: fix clang warning with C++20
> meson: update C++ standard to C++23
> contrib/plugins: add empty cpp plugin
>
> docs/devel/tcg-plugins.rst | 4 +-
> meson.build | 26 +++--
> include/{qemu => plugins}/qemu-plugin.h | 11 +-
> include/qemu/plugin.h | 2 +-
> plugins/core.c | 2 +-
> {contrib/plugins => plugins}/win32_linker.c | 0
> tests/tcg/plugins/mem.c | 59 ++++------
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++
> contrib/plugins/meson.build | 25 ++--
> plugins/meson.build | 17 ++-
> qga/vss-win32/requester.cpp | 6 +-
> scripts/clean-includes | 2 +-
> tests/tcg/plugins/meson.build | 18 +--
> 13 files changed, 204 insertions(+), 87 deletions(-)
> rename include/{qemu => plugins}/qemu-plugin.h (99%)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
> create mode 100644 contrib/plugins/cpp.cpp
>
Ping on this series.
It has been reviewed and is ready to be merged.
Thanks,
Pierrick
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 00/11] plugins: enable C++ plugins
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (11 preceding siblings ...)
2026-01-15 20:53 ` [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
@ 2026-01-16 12:35 ` Daniel P. Berrangé
2026-01-16 18:52 ` Pierrick Bouvier
2026-01-19 19:13 ` Pierrick Bouvier
13 siblings, 1 reply; 36+ messages in thread
From: Daniel P. Berrangé @ 2026-01-16 12:35 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On Fri, Jan 02, 2026 at 01:47:13PM -0800, Pierrick Bouvier wrote:
> Writing plugins in C can be sometimes tedious, especially when using Glib to
> keep track of execution state. We can directly use the same C API but write our
> plugin in C++, benefiting from its great standard library offering strings,
> smart pointers, data structures and synchronization mechanisms.
>
> It's common for downstream QEMU forks to provide C++ for plugins, like this:
> - https://github.com/panda-re/panda/tree/dev/panda/plugins
> - https://github.com/FlorentRevest/DejaView/tree/main/src/qemu_plugin
>
> Hopefully this will help more people to use upstream QEMU, and as a benefit, get
> their contribution back and help to develop plugins ecosystem upstream directly.
>
> This series first cleans up build system for plugins, factorizing details
> between contrib/plugins and tests/tcg/plugins folders.
> Then, we perform codebase cleanups to fix conflicts between existing headers
> and C++ headers.
> After that, we can update the C++ standard used by QEMU, to benefit fully
> from latest updates of the language.
> Finally, we define an empty C++ plugin, making sure we can keep track of
> possible regression in qemu-plugin header.
>
> Note: This series is *not* a trojan horse to bring C++ in QEMU
> codebase, nor to define an alternative C++ API for plugins. It's just enabling
> more users to get the most out of existing C plugin API.
That's somewhat misleading, because as the diffstat below shows,
this is indeed bringing new C++ source files into QEMU:
contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++
and the description above talks about bringing more C++ plugins in
from external forks, and the meson.build files are modified to
deal with C++.
We've had a handful of C++ files historically we've worked to
reduce, with the eventual goal of not using a C++ toolchain for
any part of QEMU build. Given that IMHO qemu.git should not be
adding new C++ sources files, even if in the plugins dir.
Since the qemu-plugin.h file should be entirely self-contained,
do we actually need to be bundling all the plugins into qemu.git ?
Should we in fact have a sepate gitlab.com/qemu/qemu-plugins repository
where we keep plugins ?
Since the qemu-plugin.h file is defining a somewhat stable API, plugins
in that separate repo ought to be able to build against multiple QEMU
releases, and could thus benefit from not being bundled together and
don't need to be on the same release cycle.
The main qemu.git CI jobs could trigger testing of a separate
qemu-plugins.git repo, so we still validate no regressions.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 36+ messages in thread* Re: [PATCH v2 00/11] plugins: enable C++ plugins
2026-01-16 12:35 ` Daniel P. Berrangé
@ 2026-01-16 18:52 ` Pierrick Bouvier
0 siblings, 0 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-16 18:52 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: qemu-devel, Gustavo Bueno Romero, Richard Henderson,
Phil Mathieu-Daudé, Manos Pitsidianakis, Alex Bennée,
Paolo Bonzini
On 1/16/26 4:35 AM, Daniel P. Berrangé wrote:
> On Fri, Jan 02, 2026 at 01:47:13PM -0800, Pierrick Bouvier wrote:
>> Writing plugins in C can be sometimes tedious, especially when using Glib to
>> keep track of execution state. We can directly use the same C API but write our
>> plugin in C++, benefiting from its great standard library offering strings,
>> smart pointers, data structures and synchronization mechanisms.
>>
>> It's common for downstream QEMU forks to provide C++ for plugins, like this:
>> - https://github.com/panda-re/panda/tree/dev/panda/plugins
>> - https://github.com/FlorentRevest/DejaView/tree/main/src/qemu_plugin
>>
>> Hopefully this will help more people to use upstream QEMU, and as a benefit, get
>> their contribution back and help to develop plugins ecosystem upstream directly.
>>
>> This series first cleans up build system for plugins, factorizing details
>> between contrib/plugins and tests/tcg/plugins folders.
>> Then, we perform codebase cleanups to fix conflicts between existing headers
>> and C++ headers.
>> After that, we can update the C++ standard used by QEMU, to benefit fully
>> from latest updates of the language.
>> Finally, we define an empty C++ plugin, making sure we can keep track of
>> possible regression in qemu-plugin header.
>>
>> Note: This series is *not* a trojan horse to bring C++ in QEMU
>> codebase, nor to define an alternative C++ API for plugins. It's just enabling
>> more users to get the most out of existing C plugin API.
>
> That's somewhat misleading, because as the diffstat below shows,
> this is indeed bringing new C++ source files into QEMU:
>
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++
>
> and the description above talks about bringing more C++ plugins in
> from external forks, and the meson.build files are modified to
> deal with C++.
>
I personally would not mind having other C++ plugins, as it would invite
people who contribute to downstream forks to contribute to upstream QEMU
instead, which may include new useful API also!
Those files will be conditioned by the presence of a C++ compiler, so
there is no impact for the people who don't want to deal with it, nor
build it.
It does not open any door to introduce C++ anywhere else.
> We've had a handful of C++ files historically we've worked to
> reduce, with the eventual goal of not using a C++ toolchain for
> any part of QEMU build. Given that IMHO qemu.git should not be
> adding new C++ sources files, even if in the plugins dir.
>
The series does not force having a C++ compiler installed, the plugin
compilation is entirely optional, so no change for existing users or CI
images.
With that, we still need to have at least one C++ file in to test if it
works. In case there is nothing checked in, there will be regression.
We are luckily catching things in CI because clang++ is there in some
images, so it will trigger an error as expected if something is introduced.
Most of the QEMU downstream forks have C++ plugins, because it's just
way more convenient.
> Since the qemu-plugin.h file should be entirely self-contained,
> do we actually need to be bundling all the plugins into qemu.git ?
>
> Should we in fact have a sepate gitlab.com/qemu/qemu-plugins repository
> where we keep plugins ?
>
2 years ago, contrib/plugins were simply sitting in their directory
without being built. As a result, they were broken when I tried to
compile them. So we added them as part of a normal build, and it solved
our problems.
Pushing things in another repository is exactly the opposite of that
direction.
It's not because you personally don't like or use a feature that it
should be in its own repository. Please kindly consider that other
people have different needs or opinions than you.
> Since the qemu-plugin.h file is defining a somewhat stable API, plugins
> in that separate repo ought to be able to build against multiple QEMU
> releases, and could thus benefit from not being bundled together and
> don't need to be on the same release cycle.
>
API is versioned but not officially stable. We may have breaking
changes, like renaming/removal of existing functions.
> The main qemu.git CI jobs could trigger testing of a separate
> qemu-plugins.git repo, so we still validate no regressions.
>
I'm not sure what is the point of breaking down things to tie them in
CI. What will happen when there is a breaking change? You now have two
broken repositories instead of a single one to fix.
> With regards,
> Daniel
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PATCH v2 00/11] plugins: enable C++ plugins
2026-01-02 21:47 [PATCH v2 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (12 preceding siblings ...)
2026-01-16 12:35 ` Daniel P. Berrangé
@ 2026-01-19 19:13 ` Pierrick Bouvier
13 siblings, 0 replies; 36+ messages in thread
From: Pierrick Bouvier @ 2026-01-19 19:13 UTC (permalink / raw)
To: qemu-devel
Cc: Gustavo Bueno Romero, Richard Henderson, Phil Mathieu-Daudé,
Manos Pitsidianakis, Alex Bennée, Paolo Bonzini,
Daniel P . Berrangé
On 1/2/26 1:47 PM, Pierrick Bouvier wrote:
> Writing plugins in C can be sometimes tedious, especially when using Glib to
> keep track of execution state. We can directly use the same C API but write our
> plugin in C++, benefiting from its great standard library offering strings,
> smart pointers, data structures and synchronization mechanisms.
>
> It's common for downstream QEMU forks to provide C++ for plugins, like this:
> - https://github.com/panda-re/panda/tree/dev/panda/plugins
> - https://github.com/FlorentRevest/DejaView/tree/main/src/qemu_plugin
>
> Hopefully this will help more people to use upstream QEMU, and as a benefit, get
> their contribution back and help to develop plugins ecosystem upstream directly.
>
> This series first cleans up build system for plugins, factorizing details
> between contrib/plugins and tests/tcg/plugins folders.
> Then, we perform codebase cleanups to fix conflicts between existing headers
> and C++ headers.
> After that, we can update the C++ standard used by QEMU, to benefit fully
> from latest updates of the language.
> Finally, we define an empty C++ plugin, making sure we can keep track of
> possible regression in qemu-plugin header.
>
> Note: This series is *not* a trojan horse to bring C++ in QEMU
> codebase, nor to define an alternative C++ API for plugins. It's just enabling
> more users to get the most out of existing C plugin API.
>
> CI: https://gitlab.com/pbo-linaro/qemu/-/pipelines/2242427013
>
> v2
> --
>
> - drop coroutine.h rename patch as it's not needed
> - drop ctype.h rename patch, and move qemu-plugin.h to include/plugins
> - fix mem.c to not depend on other QEMU headers
>
> Pierrick Bouvier (11):
> plugins: move win32_linker.c file to plugins directory
> plugins: factorize plugin dependencies and library details
> plugins: use complete filename for defining plugins sources
> plugins: define plugin API symbols as extern "C" when compiling in C++
> tests/tcg/plugins/mem.c: remove dependency on qemu headers
> plugins: move qemu-plugin.h to include/plugins/
> meson: fix supported compiler arguments in other languages than C
> meson: enable cpp (optionally) for plugins
> qga/vss-win32: fix clang warning with C++20
> meson: update C++ standard to C++23
> contrib/plugins: add empty cpp plugin
>
> docs/devel/tcg-plugins.rst | 4 +-
> meson.build | 26 +++--
> include/{qemu => plugins}/qemu-plugin.h | 11 +-
> include/qemu/plugin.h | 2 +-
> plugins/core.c | 2 +-
> {contrib/plugins => plugins}/win32_linker.c | 0
> tests/tcg/plugins/mem.c | 59 ++++------
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++++
> contrib/plugins/meson.build | 25 ++--
> plugins/meson.build | 17 ++-
> qga/vss-win32/requester.cpp | 6 +-
> scripts/clean-includes | 2 +-
> tests/tcg/plugins/meson.build | 18 +--
> 13 files changed, 204 insertions(+), 87 deletions(-)
> rename include/{qemu => plugins}/qemu-plugin.h (99%)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
> create mode 100644 contrib/plugins/cpp.cpp
>
v3 sent:
https://lore.kernel.org/qemu-devel/20260119191138.811069-1-pierrick.bouvier@linaro.org/T/#t
Regards,
Pierrick
^ permalink raw reply [flat|nested] 36+ messages in thread