* [PATCH 01/11] plugins: move win32_linker.c file to plugins directory
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 02/11] plugins: factorize plugin dependencies and library details Pierrick Bouvier
` (11 subsequent siblings)
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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] 24+ messages in thread* [PATCH 02/11] plugins: factorize plugin dependencies and library details
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
` (10 subsequent siblings)
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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] 24+ messages in thread* [PATCH 03/11] plugins: use complete filename for defining plugins sources
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 01/11] plugins: move win32_linker.c file to plugins directory Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 02/11] plugins: factorize plugin dependencies and library details Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 15:34 ` Philippe Mathieu-Daudé
2025-12-31 7:33 ` [PATCH 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
` (9 subsequent siblings)
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, Pierrick Bouvier
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] 24+ messages in thread* Re: [PATCH 03/11] plugins: use complete filename for defining plugins sources
2025-12-31 7:33 ` [PATCH 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
@ 2025-12-31 15:34 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-31 15:34 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Alex Bennée, Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Paolo Bonzini, Richard Henderson
On 31/12/25 08:33, Pierrick Bouvier wrote:
> 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(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (2 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 03/11] plugins: use complete filename for defining plugins sources Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h Pierrick Bouvier
` (8 subsequent siblings)
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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] 24+ messages in thread* [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (3 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 04/11] plugins: define plugin API symbols as extern "C" when compiling in C++ Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2026-01-01 8:38 ` Paolo Bonzini
2025-12-31 7:33 ` [PATCH 06/11] include: qemu/coroutine.h -> qemu/qemu-coroutine.h Pierrick Bouvier
` (7 subsequent siblings)
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, Pierrick Bouvier
This headers conflicts with C++ ctype header, included from iostream.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/qemu/{ctype.h => qemu-ctype.h} | 0
block/ssh.c | 2 +-
block/vvfat.c | 2 +-
gdbstub/gdbstub.c | 2 +-
hw/core/bus.c | 2 +-
hw/core/qdev-properties-system.c | 2 +-
hw/core/qdev-properties.c | 2 +-
hw/hyperv/syndbg.c | 2 +-
hw/nvme/nguid.c | 2 +-
hw/s390x/ccw-device.c | 2 +-
hw/s390x/ipl.c | 2 +-
hw/s390x/s390-virtio-ccw.c | 2 +-
hw/scsi/scsi-generic.c | 2 +-
migration/migration.c | 2 +-
monitor/fds.c | 2 +-
monitor/hmp.c | 2 +-
net/net.c | 2 +-
net/tap-solaris.c | 2 +-
qapi/qapi-util.c | 2 +-
qobject/json-parser.c | 2 +-
target/ppc/ppc-qmp-cmds.c | 2 +-
target/riscv/cpu.c | 2 +-
target/riscv/riscv-qmp-cmds.c | 2 +-
tests/qtest/libqtest.c | 2 +-
tests/qtest/migration/migration-util.c | 2 +-
tests/vhost-user-bridge.c | 2 +-
ui/keymaps.c | 2 +-
util/cutils.c | 2 +-
util/id.c | 2 +-
util/readline.c | 2 +-
30 files changed, 29 insertions(+), 29 deletions(-)
rename include/qemu/{ctype.h => qemu-ctype.h} (100%)
diff --git a/include/qemu/ctype.h b/include/qemu/qemu-ctype.h
similarity index 100%
rename from include/qemu/ctype.h
rename to include/qemu/qemu-ctype.h
diff --git a/block/ssh.c b/block/ssh.c
index bdec94e9e92..8ae7be4b423 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -34,7 +34,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/option.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/sockets.h"
#include "qapi/qapi-visit-sockets.h"
diff --git a/block/vvfat.c b/block/vvfat.c
index e334b9febb1..d495d07e5b0 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -36,7 +36,7 @@
#include "migration/blocker.h"
#include "qobject/qdict.h"
#include "qobject/qstring.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 1f8cd118924..47d4f63d4e4 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -24,7 +24,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/module.h"
#include "qemu/error-report.h"
diff --git a/hw/core/bus.c b/hw/core/bus.c
index 53f392fdda8..202c42b405d 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "hw/core/qdev-properties.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/module.h"
#include "qapi/error.h"
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index fe5464c7da1..420b60e9ba1 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -20,7 +20,7 @@
#include "qapi/qapi-types-migration.h"
#include "qapi/qapi-visit-virtio.h"
#include "qapi/qmp/qerror.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/units.h"
#include "qemu/uuid.h"
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 05489c8fbbf..3e762d83194 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -4,7 +4,7 @@
#include "qapi/qapi-types-misc.h"
#include "qapi/qapi-visit-common.h"
#include "qobject/qlist.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/error-report.h"
#include "qapi/visitor.h"
#include "qemu/units.h"
diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
index 1e177f9dd82..7219ed0f219 100644
--- a/hw/hyperv/syndbg.c
+++ b/hw/hyperv/syndbg.c
@@ -6,7 +6,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/sockets.h"
diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c
index 4cd6fad6ac9..acd73ac695b 100644
--- a/hw/nvme/nguid.c
+++ b/hw/nvme/nguid.c
@@ -16,7 +16,7 @@
#include "qemu/osdep.h"
#include "qapi/visitor.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "nvme.h"
#define NGUID_SEPARATOR '-'
diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c
index 25c42732795..6520fee7970 100644
--- a/hw/s390x/ccw-device.c
+++ b/hw/s390x/ccw-device.c
@@ -15,7 +15,7 @@
#include "qemu/module.h"
#include "ipl.h"
#include "qapi/visitor.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qapi/error.h"
static void ccw_device_refill_ids(CcwDevice *dev)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index d34adb55220..21adb5955b3 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -34,7 +34,7 @@
#include "qemu/config-file.h"
#include "qemu/cutils.h"
#include "qemu/option.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "standard-headers/linux/virtio_ids.h"
#define KERN_IMAGE_START 0x010000UL
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 8314655ec2c..217244643b6 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -19,7 +19,7 @@
#include "hw/s390x/s390_flic.h"
#include "virtio-ccw.h"
#include "qemu/config-file.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/qemu-print.h"
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 0a676a16fa4..c2563ccbdf6 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/scsi/scsi.h"
diff --git a/migration/migration.c b/migration/migration.c
index 9d1bf5d276d..5b21eb07d5e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -14,7 +14,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
diff --git a/monitor/fds.c b/monitor/fds.c
index cc35d2ec334..d98c117a9b2 100644
--- a/monitor/fds.c
+++ b/monitor/fds.c
@@ -27,7 +27,7 @@
#include "qapi/error.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qmp/qerror.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "system/runstate.h"
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 4caafbc7146..023c4e77a84 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -30,7 +30,7 @@
#include "qobject/qdict.h"
#include "qobject/qnum.h"
#include "qemu/config-file.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/log.h"
#include "qemu/option.h"
diff --git a/net/net.c b/net/net.c
index a176936f9bc..ca2f49119d5 100644
--- a/net/net.c
+++ b/net/net.c
@@ -43,7 +43,7 @@
#include "qemu/sockets.h"
#include "qemu/cutils.h"
#include "qemu/config-file.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/id.h"
#include "qemu/iov.h"
#include "qemu/qemu-print.h"
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 75397e6c544..6e1da970d98 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -25,7 +25,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "tap_int.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "net/net.h"
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index 3d849fe0347..b372c74dd04 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "qapi/compat-policy.h"
#include "qapi/error.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qapi/qmp/qerror.h"
CompatPolicy compat_policy;
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 7483e582fea..7c5618ba3f3 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -12,7 +12,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/unicode.h"
#include "qapi/error.h"
diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c
index 7022564604f..ae9711a21e3 100644
--- a/target/ppc/ppc-qmp-cmds.c
+++ b/target/ppc/ppc-qmp-cmds.c
@@ -25,7 +25,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
#include "qapi/error.h"
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 8f26d8b8b07..17df96913ce 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "qemu/qemu-print.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/log.h"
#include "cpu.h"
#include "cpu_vendorid.h"
diff --git a/target/riscv/riscv-qmp-cmds.c b/target/riscv/riscv-qmp-cmds.c
index d5e9bec0f86..618007fc0f9 100644
--- a/target/riscv/riscv-qmp-cmds.c
+++ b/target/riscv/riscv-qmp-cmds.c
@@ -31,7 +31,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi/visitor.h"
#include "qom/qom-qobject.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/qemu-print.h"
#include "monitor/hmp.h"
#include "monitor/hmp-target.h"
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 622464e3656..10a01ba76fa 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -31,7 +31,7 @@
#include "libqtest.h"
#include "libqmp.h"
#include "qemu/accel.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/exit-with-parent.h"
#include "qemu/sockets.h"
diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration/migration-util.c
index c2462306a15..1c6dbb6c19b 100644
--- a/tests/qtest/migration/migration-util.c
+++ b/tests/qtest/migration/migration-util.c
@@ -11,7 +11,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qapi/qapi-visit-sockets.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/error.h"
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index ce4c3426d39..cb852194dd0 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -31,7 +31,7 @@
#include "qemu/osdep.h"
#include "qemu/atomic.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/iov.h"
#include "standard-headers/linux/virtio_net.h"
#include "libvhost-user.h"
diff --git a/ui/keymaps.c b/ui/keymaps.c
index 2359dbfe7e6..6dfd5a45ee3 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -26,7 +26,7 @@
#include "qemu/datadir.h"
#include "keymaps.h"
#include "trace.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "ui/input.h"
diff --git a/util/cutils.c b/util/cutils.c
index 9803f11a596..2c0a9926893 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -48,7 +48,7 @@
#include <wchar.h>
#endif
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
diff --git a/util/id.c b/util/id.c
index ded41c5025e..0ba538dce81 100644
--- a/util/id.c
+++ b/util/id.c
@@ -11,7 +11,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/id.h"
bool id_wellformed(const char *id)
diff --git a/util/readline.c b/util/readline.c
index 0f19674f526..f756d384625 100644
--- a/util/readline.c
+++ b/util/readline.c
@@ -24,7 +24,7 @@
#include "qemu/osdep.h"
#include "qemu/readline.h"
-#include "qemu/ctype.h"
+#include "qemu/qemu-ctype.h"
#include "qemu/cutils.h"
#define IS_NORM 0
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h
2025-12-31 7:33 ` [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h Pierrick Bouvier
@ 2026-01-01 8:38 ` Paolo Bonzini
2026-01-02 5:01 ` Pierrick Bouvier
0 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2026-01-01 8:38 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Phil Mathieu-Daudé, Alex Bennée,
Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 13301 bytes --]
Il mer 31 dic 2025, 08:34 Pierrick Bouvier <pierrick.bouvier@linaro.org> ha
scritto:
> This headers conflicts with C++ ctype header, included from iostream.
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>
Stupid question sorry: the header is meant to be included as qemu/ctype.h,
not ctype.h; why is include/qemu/ on the include path instead of just
include/? Can the include path be changed instead?
Paolo
---
> include/qemu/{ctype.h => qemu-ctype.h} | 0
> block/ssh.c | 2 +-
> block/vvfat.c | 2 +-
> gdbstub/gdbstub.c | 2 +-
> hw/core/bus.c | 2 +-
> hw/core/qdev-properties-system.c | 2 +-
> hw/core/qdev-properties.c | 2 +-
> hw/hyperv/syndbg.c | 2 +-
> hw/nvme/nguid.c | 2 +-
> hw/s390x/ccw-device.c | 2 +-
> hw/s390x/ipl.c | 2 +-
> hw/s390x/s390-virtio-ccw.c | 2 +-
> hw/scsi/scsi-generic.c | 2 +-
> migration/migration.c | 2 +-
> monitor/fds.c | 2 +-
> monitor/hmp.c | 2 +-
> net/net.c | 2 +-
> net/tap-solaris.c | 2 +-
> qapi/qapi-util.c | 2 +-
> qobject/json-parser.c | 2 +-
> target/ppc/ppc-qmp-cmds.c | 2 +-
> target/riscv/cpu.c | 2 +-
> target/riscv/riscv-qmp-cmds.c | 2 +-
> tests/qtest/libqtest.c | 2 +-
> tests/qtest/migration/migration-util.c | 2 +-
> tests/vhost-user-bridge.c | 2 +-
> ui/keymaps.c | 2 +-
> util/cutils.c | 2 +-
> util/id.c | 2 +-
> util/readline.c | 2 +-
> 30 files changed, 29 insertions(+), 29 deletions(-)
> rename include/qemu/{ctype.h => qemu-ctype.h} (100%)
>
> diff --git a/include/qemu/ctype.h b/include/qemu/qemu-ctype.h
> similarity index 100%
> rename from include/qemu/ctype.h
> rename to include/qemu/qemu-ctype.h
> diff --git a/block/ssh.c b/block/ssh.c
> index bdec94e9e92..8ae7be4b423 100644
> --- a/block/ssh.c
> +++ b/block/ssh.c
> @@ -34,7 +34,7 @@
> #include "qemu/error-report.h"
> #include "qemu/module.h"
> #include "qemu/option.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/sockets.h"
> #include "qapi/qapi-visit-sockets.h"
> diff --git a/block/vvfat.c b/block/vvfat.c
> index e334b9febb1..d495d07e5b0 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -36,7 +36,7 @@
> #include "migration/blocker.h"
> #include "qobject/qdict.h"
> #include "qobject/qstring.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/error-report.h"
>
> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
> index 1f8cd118924..47d4f63d4e4 100644
> --- a/gdbstub/gdbstub.c
> +++ b/gdbstub/gdbstub.c
> @@ -24,7 +24,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/module.h"
> #include "qemu/error-report.h"
> diff --git a/hw/core/bus.c b/hw/core/bus.c
> index 53f392fdda8..202c42b405d 100644
> --- a/hw/core/bus.c
> +++ b/hw/core/bus.c
> @@ -19,7 +19,7 @@
>
> #include "qemu/osdep.h"
> #include "hw/core/qdev-properties.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/module.h"
> #include "qapi/error.h"
>
> diff --git a/hw/core/qdev-properties-system.c
> b/hw/core/qdev-properties-system.c
> index fe5464c7da1..420b60e9ba1 100644
> --- a/hw/core/qdev-properties-system.c
> +++ b/hw/core/qdev-properties-system.c
> @@ -20,7 +20,7 @@
> #include "qapi/qapi-types-migration.h"
> #include "qapi/qapi-visit-virtio.h"
> #include "qapi/qmp/qerror.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/units.h"
> #include "qemu/uuid.h"
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 05489c8fbbf..3e762d83194 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -4,7 +4,7 @@
> #include "qapi/qapi-types-misc.h"
> #include "qapi/qapi-visit-common.h"
> #include "qobject/qlist.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/error-report.h"
> #include "qapi/visitor.h"
> #include "qemu/units.h"
> diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
> index 1e177f9dd82..7219ed0f219 100644
> --- a/hw/hyperv/syndbg.c
> +++ b/hw/hyperv/syndbg.c
> @@ -6,7 +6,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/error-report.h"
> #include "qemu/main-loop.h"
> #include "qemu/sockets.h"
> diff --git a/hw/nvme/nguid.c b/hw/nvme/nguid.c
> index 4cd6fad6ac9..acd73ac695b 100644
> --- a/hw/nvme/nguid.c
> +++ b/hw/nvme/nguid.c
> @@ -16,7 +16,7 @@
>
> #include "qemu/osdep.h"
> #include "qapi/visitor.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "nvme.h"
>
> #define NGUID_SEPARATOR '-'
> diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c
> index 25c42732795..6520fee7970 100644
> --- a/hw/s390x/ccw-device.c
> +++ b/hw/s390x/ccw-device.c
> @@ -15,7 +15,7 @@
> #include "qemu/module.h"
> #include "ipl.h"
> #include "qapi/visitor.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qapi/error.h"
>
> static void ccw_device_refill_ids(CcwDevice *dev)
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index d34adb55220..21adb5955b3 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -34,7 +34,7 @@
> #include "qemu/config-file.h"
> #include "qemu/cutils.h"
> #include "qemu/option.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "standard-headers/linux/virtio_ids.h"
>
> #define KERN_IMAGE_START 0x010000UL
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 8314655ec2c..217244643b6 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -19,7 +19,7 @@
> #include "hw/s390x/s390_flic.h"
> #include "virtio-ccw.h"
> #include "qemu/config-file.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/error-report.h"
> #include "qemu/option.h"
> #include "qemu/qemu-print.h"
> diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
> index 0a676a16fa4..c2563ccbdf6 100644
> --- a/hw/scsi/scsi-generic.c
> +++ b/hw/scsi/scsi-generic.c
> @@ -13,7 +13,7 @@
>
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/error-report.h"
> #include "qemu/module.h"
> #include "hw/scsi/scsi.h"
> diff --git a/migration/migration.c b/migration/migration.c
> index 9d1bf5d276d..5b21eb07d5e 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -14,7 +14,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/error-report.h"
> #include "qemu/main-loop.h"
> diff --git a/monitor/fds.c b/monitor/fds.c
> index cc35d2ec334..d98c117a9b2 100644
> --- a/monitor/fds.c
> +++ b/monitor/fds.c
> @@ -27,7 +27,7 @@
> #include "qapi/error.h"
> #include "qapi/qapi-commands-misc.h"
> #include "qapi/qmp/qerror.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "system/runstate.h"
>
> diff --git a/monitor/hmp.c b/monitor/hmp.c
> index 4caafbc7146..023c4e77a84 100644
> --- a/monitor/hmp.c
> +++ b/monitor/hmp.c
> @@ -30,7 +30,7 @@
> #include "qobject/qdict.h"
> #include "qobject/qnum.h"
> #include "qemu/config-file.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/log.h"
> #include "qemu/option.h"
> diff --git a/net/net.c b/net/net.c
> index a176936f9bc..ca2f49119d5 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -43,7 +43,7 @@
> #include "qemu/sockets.h"
> #include "qemu/cutils.h"
> #include "qemu/config-file.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/id.h"
> #include "qemu/iov.h"
> #include "qemu/qemu-print.h"
> diff --git a/net/tap-solaris.c b/net/tap-solaris.c
> index 75397e6c544..6e1da970d98 100644
> --- a/net/tap-solaris.c
> +++ b/net/tap-solaris.c
> @@ -25,7 +25,7 @@
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "tap_int.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "net/net.h"
>
> diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
> index 3d849fe0347..b372c74dd04 100644
> --- a/qapi/qapi-util.c
> +++ b/qapi/qapi-util.c
> @@ -13,7 +13,7 @@
> #include "qemu/osdep.h"
> #include "qapi/compat-policy.h"
> #include "qapi/error.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qapi/qmp/qerror.h"
>
> CompatPolicy compat_policy;
> diff --git a/qobject/json-parser.c b/qobject/json-parser.c
> index 7483e582fea..7c5618ba3f3 100644
> --- a/qobject/json-parser.c
> +++ b/qobject/json-parser.c
> @@ -12,7 +12,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/unicode.h"
> #include "qapi/error.h"
> diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c
> index 7022564604f..ae9711a21e3 100644
> --- a/target/ppc/ppc-qmp-cmds.c
> +++ b/target/ppc/ppc-qmp-cmds.c
> @@ -25,7 +25,7 @@
> #include "qemu/osdep.h"
> #include "cpu.h"
> #include "monitor/monitor.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "monitor/hmp-target.h"
> #include "monitor/hmp.h"
> #include "qapi/error.h"
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 8f26d8b8b07..17df96913ce 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -19,7 +19,7 @@
>
> #include "qemu/osdep.h"
> #include "qemu/qemu-print.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/log.h"
> #include "cpu.h"
> #include "cpu_vendorid.h"
> diff --git a/target/riscv/riscv-qmp-cmds.c b/target/riscv/riscv-qmp-cmds.c
> index d5e9bec0f86..618007fc0f9 100644
> --- a/target/riscv/riscv-qmp-cmds.c
> +++ b/target/riscv/riscv-qmp-cmds.c
> @@ -31,7 +31,7 @@
> #include "qapi/qobject-input-visitor.h"
> #include "qapi/visitor.h"
> #include "qom/qom-qobject.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/qemu-print.h"
> #include "monitor/hmp.h"
> #include "monitor/hmp-target.h"
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 622464e3656..10a01ba76fa 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -31,7 +31,7 @@
> #include "libqtest.h"
> #include "libqmp.h"
> #include "qemu/accel.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/exit-with-parent.h"
> #include "qemu/sockets.h"
> diff --git a/tests/qtest/migration/migration-util.c
> b/tests/qtest/migration/migration-util.c
> index c2462306a15..1c6dbb6c19b 100644
> --- a/tests/qtest/migration/migration-util.c
> +++ b/tests/qtest/migration/migration-util.c
> @@ -11,7 +11,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qapi/qapi-visit-sockets.h"
> #include "qapi/qobject-input-visitor.h"
> #include "qapi/error.h"
> diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
> index ce4c3426d39..cb852194dd0 100644
> --- a/tests/vhost-user-bridge.c
> +++ b/tests/vhost-user-bridge.c
> @@ -31,7 +31,7 @@
>
> #include "qemu/osdep.h"
> #include "qemu/atomic.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/iov.h"
> #include "standard-headers/linux/virtio_net.h"
> #include "libvhost-user.h"
> diff --git a/ui/keymaps.c b/ui/keymaps.c
> index 2359dbfe7e6..6dfd5a45ee3 100644
> --- a/ui/keymaps.c
> +++ b/ui/keymaps.c
> @@ -26,7 +26,7 @@
> #include "qemu/datadir.h"
> #include "keymaps.h"
> #include "trace.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/error-report.h"
> #include "qapi/error.h"
> #include "ui/input.h"
> diff --git a/util/cutils.c b/util/cutils.c
> index 9803f11a596..2c0a9926893 100644
> --- a/util/cutils.c
> +++ b/util/cutils.c
> @@ -48,7 +48,7 @@
> #include <wchar.h>
> #endif
>
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
> #include "qemu/error-report.h"
>
> diff --git a/util/id.c b/util/id.c
> index ded41c5025e..0ba538dce81 100644
> --- a/util/id.c
> +++ b/util/id.c
> @@ -11,7 +11,7 @@
> */
>
> #include "qemu/osdep.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/id.h"
>
> bool id_wellformed(const char *id)
> diff --git a/util/readline.c b/util/readline.c
> index 0f19674f526..f756d384625 100644
> --- a/util/readline.c
> +++ b/util/readline.c
> @@ -24,7 +24,7 @@
>
> #include "qemu/osdep.h"
> #include "qemu/readline.h"
> -#include "qemu/ctype.h"
> +#include "qemu/qemu-ctype.h"
> #include "qemu/cutils.h"
>
> #define IS_NORM 0
> --
> 2.47.3
>
>
[-- Attachment #2: Type: text/html, Size: 17775 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h
2026-01-01 8:38 ` Paolo Bonzini
@ 2026-01-02 5:01 ` Pierrick Bouvier
2026-01-02 5:11 ` Paolo Bonzini
0 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 5:01 UTC (permalink / raw)
To: Paolo Bonzini
Cc: qemu-devel, Phil Mathieu-Daudé, Alex Bennée,
Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Richard Henderson
On 1/1/26 12:38 AM, Paolo Bonzini wrote:
>
>
> Il mer 31 dic 2025, 08:34 Pierrick Bouvier <pierrick.bouvier@linaro.org
> <mailto:pierrick.bouvier@linaro.org>> ha scritto:
>
> This headers conflicts with C++ ctype header, included from iostream.
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org
> <mailto:pierrick.bouvier@linaro.org>>
>
>
> Stupid question sorry: the header is meant to be included as qemu/
> ctype.h, not ctype.h; why is include/qemu/ on the include path instead
> of just include/? Can the include path be changed instead?
>
That's not a stupid question. Looking at it, inclusion comes from
plugins themselves, to include <qemu-plugin.h> instead of
<qemu/qemu-plugin.h>. I thought it was needed somewhere else also.
I think the rationale is to make sure that people can't pull anything
out of include/qemu from plugins code, which makes sense. That said,
there is still a lot of stuff that can be included from this folder.
Thinking about all this, a good solution could be to isolate
<qemu-plugin.h> in a new subfolder (include/plugins). This way, we make
sure plugins are properly isolated, and there won't be any conflict with
existing ctype header, so this patch can be dropped.
What do you think about this?
> Paolo
>
Regards,
Pierrick
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h
2026-01-02 5:01 ` Pierrick Bouvier
@ 2026-01-02 5:11 ` Paolo Bonzini
2026-01-02 6:17 ` Pierrick Bouvier
0 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2026-01-02 5:11 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Phil Mathieu-Daudé, Alex Bennée,
Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
Il ven 2 gen 2026, 06:01 Pierrick Bouvier <pierrick.bouvier@linaro.org> ha
scritto:
>
>
> Thinking about all this, a good solution could be to isolate
> <qemu-plugin.h> in a new subfolder (include/plugins). This way, we make
> sure plugins are properly isolated, and there won't be any conflict with
> existing ctype header, so this patch can be dropped.
>
> What do you think about this?
>
That's exactly how I thought it already worked. :)
Paolo
> > Paolo
> >
>
> Regards,
> Pierrick
>
>
[-- Attachment #2: Type: text/html, Size: 1219 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h
2026-01-02 5:11 ` Paolo Bonzini
@ 2026-01-02 6:17 ` Pierrick Bouvier
0 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 6:17 UTC (permalink / raw)
To: Paolo Bonzini
Cc: qemu-devel, Phil Mathieu-Daudé, Alex Bennée,
Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Richard Henderson
On 1/1/26 9:11 PM, Paolo Bonzini wrote:
>
>
> Il ven 2 gen 2026, 06:01 Pierrick Bouvier <pierrick.bouvier@linaro.org
> <mailto:pierrick.bouvier@linaro.org>> ha scritto:
>
>
>
> Thinking about all this, a good solution could be to isolate
> <qemu-plugin.h> in a new subfolder (include/plugins). This way, we make
> sure plugins are properly isolated, and there won't be any conflict
> with
> existing ctype header, so this patch can be dropped.
>
> What do you think about this?
>
>
> That's exactly how I thought it already worked. :)
>
Ok, I'll migrate the header to a new cosy folder, and we should be good
for this part!
Thanks
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 06/11] include: qemu/coroutine.h -> qemu/qemu-coroutine.h
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (4 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 05/11] include: qemu/ctype.h -> qemu/qemu-ctype.h Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 17:19 ` Pierrick Bouvier
2025-12-31 7:33 ` [PATCH 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
` (6 subsequent siblings)
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, Pierrick Bouvier
This header conflicts with C++ coroutine header.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
block/parallels.h | 2 +-
block/qcow2.h | 2 +-
fsdev/qemu-fsdev-throttle.h | 2 +-
hw/9pfs/9p.h | 2 +-
include/block/block-global-state.h | 2 +-
include/block/block-hmp-cmds.h | 2 +-
include/block/block-io.h | 2 +-
include/block/reqlist.h | 2 +-
include/block/throttle-groups.h | 2 +-
include/qemu/coroutine_int.h | 2 +-
include/qemu/job.h | 2 +-
include/qemu/{coroutine.h => qemu-coroutine.h} | 0
migration/migration.h | 2 +-
ui/console-priv.h | 2 +-
block.c | 2 +-
block/block-copy.c | 2 +-
block/io_uring.c | 2 +-
block/linux-aio.c | 2 +-
block/mirror.c | 2 +-
block/progress_meter.c | 2 +-
block/vdi.c | 2 +-
chardev/char.c | 2 +-
hw/9pfs/coth.c | 2 +-
hw/block/virtio-blk.c | 2 +-
migration/rdma.c | 2 +-
nbd/client-connection.c | 2 +-
net/colo-compare.c | 2 +-
qapi/qmp-dispatch.c | 2 +-
tests/unit/test-aio-multithread.c | 2 +-
ui/console.c | 2 +-
ui/ui-qmp-cmds.c | 2 +-
util/qemu-co-shared-resource.c | 2 +-
util/qemu-co-timeout.c | 2 +-
util/qemu-coroutine-io.c | 2 +-
util/thread-pool.c | 2 +-
35 files changed, 34 insertions(+), 34 deletions(-)
rename include/qemu/{coroutine.h => qemu-coroutine.h} (100%)
diff --git a/block/parallels.h b/block/parallels.h
index 423b2ad7271..7836b68d491 100644
--- a/block/parallels.h
+++ b/block/parallels.h
@@ -31,7 +31,7 @@
*/
#ifndef BLOCK_PARALLELS_H
#define BLOCK_PARALLELS_H
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#define HEADS_NUMBER 16
#define SEC_IN_CYL 32
diff --git a/block/qcow2.h b/block/qcow2.h
index 96db7c51ec2..f139d64659f 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -26,7 +26,7 @@
#define BLOCK_QCOW2_H
#include "crypto/block.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/units.h"
#include "block/block_int.h"
diff --git a/fsdev/qemu-fsdev-throttle.h b/fsdev/qemu-fsdev-throttle.h
index a1dc0307903..6e54991deba 100644
--- a/fsdev/qemu-fsdev-throttle.h
+++ b/fsdev/qemu-fsdev-throttle.h
@@ -15,7 +15,7 @@
#ifndef QEMU_FSDEV_THROTTLE_H
#define QEMU_FSDEV_THROTTLE_H
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/throttle.h"
typedef struct FsThrottle {
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 65cc45e344f..d380d8bec62 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -7,7 +7,7 @@
#include "fsdev/file-op-9p.h"
#include "fsdev/9p-iov-marshal.h"
#include "qemu/thread.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/qht.h"
enum {
diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h
index ed89999f0fb..70c6c91d275 100644
--- a/include/block/block-global-state.h
+++ b/include/block/block-global-state.h
@@ -27,7 +27,7 @@
#include "qemu/aiocb.h"
#include "block/graph-lock.h"
#include "block/block-common.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/transactions.h"
/*
diff --git a/include/block/block-hmp-cmds.h b/include/block/block-hmp-cmds.h
index 71113cd7efa..72d0e8bdc37 100644
--- a/include/block/block-hmp-cmds.h
+++ b/include/block/block-hmp-cmds.h
@@ -15,7 +15,7 @@
#ifndef BLOCK_BLOCK_HMP_CMDS_H
#define BLOCK_BLOCK_HMP_CMDS_H
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
void hmp_drive_add(Monitor *mon, const QDict *qdict);
diff --git a/include/block/block-io.h b/include/block/block-io.h
index d34d846bb2a..cd33872c26f 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -28,7 +28,7 @@
#include "qemu/aio-wait.h"
#include "block/block-common.h"
#include "block/graph-lock.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/iov.h"
/*
diff --git a/include/block/reqlist.h b/include/block/reqlist.h
index 5253497bae3..25b9329a0cd 100644
--- a/include/block/reqlist.h
+++ b/include/block/reqlist.h
@@ -15,7 +15,7 @@
#ifndef REQLIST_H
#define REQLIST_H
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
/*
* The API is not thread-safe and shouldn't be. The struct is public to be part
diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h
index 2355e8d9de6..f88160d0c5a 100644
--- a/include/block/throttle-groups.h
+++ b/include/block/throttle-groups.h
@@ -25,7 +25,7 @@
#ifndef THROTTLE_GROUPS_H
#define THROTTLE_GROUPS_H
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/throttle.h"
#include "qom/object.h"
diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h
index 1da148552f7..a2985bb6e11 100644
--- a/include/qemu/coroutine_int.h
+++ b/include/qemu/coroutine_int.h
@@ -26,7 +26,7 @@
#define QEMU_COROUTINE_INT_H
#include "qemu/queue.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#ifdef CONFIG_SAFESTACK
/* Pointer to the unsafe stack, defined by the compiler */
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 0e40e8b4570..04ba53ac3b6 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -30,7 +30,7 @@
#include "qemu/aiocb.h"
#include "qemu/queue.h"
#include "qemu/progress_meter.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/aio.h"
#include "block/graph-lock.h"
diff --git a/include/qemu/coroutine.h b/include/qemu/qemu-coroutine.h
similarity index 100%
rename from include/qemu/coroutine.h
rename to include/qemu/qemu-coroutine.h
diff --git a/migration/migration.h b/migration/migration.h
index ccc4e536a57..ad3aad5b1a8 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -20,7 +20,7 @@
#include "qapi/qapi-types-migration.h"
#include "qobject/json-writer.h"
#include "qemu/thread.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "io/channel.h"
#include "io/channel-buffer.h"
#include "net/announce.h"
diff --git a/ui/console-priv.h b/ui/console-priv.h
index 43ceb8122f1..320ae93af18 100644
--- a/ui/console-priv.h
+++ b/ui/console-priv.h
@@ -6,7 +6,7 @@
#define CONSOLE_PRIV_H
#include "ui/console.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/timer.h"
#include "vgafont.h"
diff --git a/block.c b/block.c
index 48a17f393c5..d9b3dfa23fa 100644
--- a/block.c
+++ b/block.c
@@ -45,7 +45,7 @@
#include "system/block-backend.h"
#include "qemu/notify.h"
#include "qemu/option.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "block/qapi.h"
#include "qemu/timer.h"
#include "qemu/cutils.h"
diff --git a/block/block-copy.c b/block/block-copy.c
index 1826c2e1c7b..c800946efbb 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -23,7 +23,7 @@
#include "system/block-backend.h"
#include "qemu/units.h"
#include "qemu/co-shared-resource.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/ratelimit.h"
#include "block/aio_task.h"
#include "qemu/error-report.h"
diff --git a/block/io_uring.c b/block/io_uring.c
index cb131d3b8b5..940c1ca53b3 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -13,7 +13,7 @@
#include "qemu/aio.h"
#include "block/block.h"
#include "block/raw-aio.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "system/block-backend.h"
#include "trace.h"
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 53c3e9af8ae..53831b17695 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -13,7 +13,7 @@
#include "block/block.h"
#include "block/raw-aio.h"
#include "qemu/event_notifier.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/defer-call.h"
#include "qapi/error.h"
#include "system/block-backend.h"
diff --git a/block/mirror.c b/block/mirror.c
index b344182c747..8de0a8dfc89 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/range.h"
#include "trace.h"
#include "block/blockjob_int.h"
diff --git a/block/progress_meter.c b/block/progress_meter.c
index 31a170a2cd6..6ad9be5f83f 100644
--- a/block/progress_meter.c
+++ b/block/progress_meter.c
@@ -25,7 +25,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/progress_meter.h"
void progress_init(ProgressMeter *pm)
diff --git a/block/vdi.c b/block/vdi.c
index 87b874a7ef5..b42314e08ad 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -63,7 +63,7 @@
#include "qemu/option.h"
#include "qemu/bswap.h"
#include "migration/blocker.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/cutils.h"
#include "qemu/uuid.h"
#include "qemu/memalign.h"
diff --git a/chardev/char.c b/chardev/char.c
index 3e432195a5a..7ff440d884e 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -38,7 +38,7 @@
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/id.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/yank.h"
#include "chardev-internal.h"
diff --git a/hw/9pfs/coth.c b/hw/9pfs/coth.c
index 598f46add99..eda52fe28f1 100644
--- a/hw/9pfs/coth.c
+++ b/hw/9pfs/coth.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "block/thread-pool.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/main-loop.h"
#include "coth.h"
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index ddf0e9ee53e..07be8a3b387 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -36,7 +36,7 @@
#include "hw/virtio/iothread-vq-mapping.h"
#include "hw/virtio/virtio-access.h"
#include "hw/virtio/virtio-blk-common.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
static void virtio_blk_ioeventfd_attach(VirtIOBlock *s);
diff --git a/migration/rdma.c b/migration/rdma.c
index 337b4158899..589048c6978 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -29,7 +29,7 @@
#include "qemu/rcu.h"
#include "qemu/sockets.h"
#include "qemu/bitmap.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "system/memory.h"
#include <sys/socket.h>
#include <netdb.h>
diff --git a/nbd/client-connection.c b/nbd/client-connection.c
index 79ea97e4cc1..22247b16c34 100644
--- a/nbd/client-connection.c
+++ b/nbd/client-connection.c
@@ -29,7 +29,7 @@
#include "qapi/qapi-visit-sockets.h"
#include "qapi/clone-visitor.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "nbd/nbd-internal.h"
diff --git a/net/colo-compare.c b/net/colo-compare.c
index c356419d6a8..4d308e777c8 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -31,7 +31,7 @@
#include "util.h"
#include "qemu/aio-wait.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#define TYPE_COLO_COMPARE "colo-compare"
typedef struct CompareState CompareState;
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 9bb1e6a9f4a..9df35654f27 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -22,7 +22,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
#include "qobject/qbool.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/main-loop.h"
Visitor *qobject_input_visitor_new_qmp(QObject *obj)
diff --git a/tests/unit/test-aio-multithread.c b/tests/unit/test-aio-multithread.c
index 9179cdc6a32..a6923a7f572 100644
--- a/tests/unit/test-aio-multithread.c
+++ b/tests/unit/test-aio-multithread.c
@@ -12,7 +12,7 @@
#include "qemu/osdep.h"
#include "qemu/aio.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/thread.h"
#include "qemu/error-report.h"
#include "iothread.h"
diff --git a/ui/console.c b/ui/console.c
index f445db11389..7556256ef04 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -28,7 +28,7 @@
#include "qapi/error.h"
#include "qapi/qapi-commands-ui.h"
#include "qapi/visitor.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c
index 74fa6c6ec5a..3be35797343 100644
--- a/ui/ui-qmp-cmds.c
+++ b/ui/ui-qmp-cmds.c
@@ -19,7 +19,7 @@
#include "monitor/qmp-helpers.h"
#include "qapi/qapi-commands-ui.h"
#include "qapi/qmp/qerror.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/cutils.h"
#include "trace.h"
#include "ui/console.h"
diff --git a/util/qemu-co-shared-resource.c b/util/qemu-co-shared-resource.c
index 752eb5a1c5f..52ce4414bfe 100644
--- a/util/qemu-co-shared-resource.c
+++ b/util/qemu-co-shared-resource.c
@@ -24,7 +24,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/co-shared-resource.h"
struct SharedResource {
diff --git a/util/qemu-co-timeout.c b/util/qemu-co-timeout.c
index 6774440b287..edc533ff7cf 100644
--- a/util/qemu-co-timeout.c
+++ b/util/qemu-co-timeout.c
@@ -24,7 +24,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/aio.h"
typedef struct QemuCoTimeoutState {
diff --git a/util/qemu-coroutine-io.c b/util/qemu-coroutine-io.c
index 364f4d5abf5..2d88458fadd 100644
--- a/util/qemu-coroutine-io.c
+++ b/util/qemu-coroutine-io.c
@@ -24,7 +24,7 @@
*/
#include "qemu/osdep.h"
#include "qemu/sockets.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "qemu/iov.h"
#include "qemu/main-loop.h"
diff --git a/util/thread-pool.c b/util/thread-pool.c
index 8f8cb38d5ce..d85b0b04293 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -19,7 +19,7 @@
#include "qemu/queue.h"
#include "qemu/thread.h"
#include "qemu/atomic.h"
-#include "qemu/coroutine.h"
+#include "qemu/qemu-coroutine.h"
#include "trace.h"
#include "block/thread-pool.h"
#include "qemu/main-loop.h"
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 06/11] include: qemu/coroutine.h -> qemu/qemu-coroutine.h
2025-12-31 7:33 ` [PATCH 06/11] include: qemu/coroutine.h -> qemu/qemu-coroutine.h Pierrick Bouvier
@ 2025-12-31 17:19 ` Pierrick Bouvier
0 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 17:19 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson
On 12/30/25 11:33 PM, Pierrick Bouvier wrote:
> This header conflicts with C++ coroutine header.
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> block/parallels.h | 2 +-
> block/qcow2.h | 2 +-
> fsdev/qemu-fsdev-throttle.h | 2 +-
> hw/9pfs/9p.h | 2 +-
> include/block/block-global-state.h | 2 +-
> include/block/block-hmp-cmds.h | 2 +-
> include/block/block-io.h | 2 +-
> include/block/reqlist.h | 2 +-
> include/block/throttle-groups.h | 2 +-
> include/qemu/coroutine_int.h | 2 +-
> include/qemu/job.h | 2 +-
> include/qemu/{coroutine.h => qemu-coroutine.h} | 0
> migration/migration.h | 2 +-
> ui/console-priv.h | 2 +-
> block.c | 2 +-
> block/block-copy.c | 2 +-
> block/io_uring.c | 2 +-
> block/linux-aio.c | 2 +-
> block/mirror.c | 2 +-
> block/progress_meter.c | 2 +-
> block/vdi.c | 2 +-
> chardev/char.c | 2 +-
> hw/9pfs/coth.c | 2 +-
> hw/block/virtio-blk.c | 2 +-
> migration/rdma.c | 2 +-
> nbd/client-connection.c | 2 +-
> net/colo-compare.c | 2 +-
> qapi/qmp-dispatch.c | 2 +-
> tests/unit/test-aio-multithread.c | 2 +-
> ui/console.c | 2 +-
> ui/ui-qmp-cmds.c | 2 +-
> util/qemu-co-shared-resource.c | 2 +-
> util/qemu-co-timeout.c | 2 +-
> util/qemu-coroutine-io.c | 2 +-
> util/thread-pool.c | 2 +-
> 35 files changed, 34 insertions(+), 34 deletions(-)
> rename include/qemu/{coroutine.h => qemu-coroutine.h} (100%)
>
This patch was a premature cleanup after fixing ctype.h, coroutine.h
does not conflicts with coroutine C++ header (no .h).
Thus, I will remove it from next version.
Regards,
Pierrick
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 07/11] meson: fix supported compiler arguments in other languages than C
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (5 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 06/11] include: qemu/coroutine.h -> qemu/qemu-coroutine.h Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 15:36 ` Philippe Mathieu-Daudé
2025-12-31 7:33 ` [PATCH 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
` (5 subsequent siblings)
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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.
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 3d6c6c702d0..c7042413f20 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] 24+ messages in thread* Re: [PATCH 07/11] meson: fix supported compiler arguments in other languages than C
2025-12-31 7:33 ` [PATCH 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
@ 2025-12-31 15:36 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-31 15:36 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Alex Bennée, Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Paolo Bonzini, Richard Henderson
On 31/12/25 08:33, Pierrick Bouvier 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.
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> meson.build | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 08/11] meson: enable cpp (optionally) for plugins
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (6 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 07/11] meson: fix supported compiler arguments in other languages than C Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 15:37 ` Philippe Mathieu-Daudé
2025-12-31 7:33 ` [PATCH 09/11] qga/vss-win32: fix clang warning with C++20 Pierrick Bouvier
` (4 subsequent siblings)
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, Pierrick Bouvier
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 c7042413f20..ecfacaf2ac1 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] 24+ messages in thread* Re: [PATCH 08/11] meson: enable cpp (optionally) for plugins
2025-12-31 7:33 ` [PATCH 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
@ 2025-12-31 15:37 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-31 15:37 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Alex Bennée, Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Paolo Bonzini, Richard Henderson
On 31/12/25 08:33, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 09/11] qga/vss-win32: fix clang warning with C++20
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (7 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 08/11] meson: enable cpp (optionally) for plugins Pierrick Bouvier
@ 2025-12-31 7:33 ` Pierrick Bouvier
2025-12-31 7:34 ` [PATCH 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
` (3 subsequent siblings)
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:33 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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] 24+ messages in thread* [PATCH 10/11] meson: update C++ standard to C++23
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (8 preceding siblings ...)
2025-12-31 7:33 ` [PATCH 09/11] qga/vss-win32: fix clang warning with C++20 Pierrick Bouvier
@ 2025-12-31 7:34 ` Pierrick Bouvier
2025-12-31 7:34 ` [PATCH 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
` (2 subsequent siblings)
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:34 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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 ecfacaf2ac1..9eaa7e2c8d4 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] 24+ messages in thread* [PATCH 11/11] contrib/plugins: add empty cpp plugin
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (9 preceding siblings ...)
2025-12-31 7:34 ` [PATCH 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
@ 2025-12-31 7:34 ` Pierrick Bouvier
2025-12-31 15:39 ` Philippe Mathieu-Daudé
2026-01-02 10:35 ` [PATCH 00/11] plugins: enable C++ plugins Alex Bennée
2026-01-02 21:49 ` Pierrick Bouvier
12 siblings, 1 reply; 24+ messages in thread
From: Pierrick Bouvier @ 2025-12-31 7:34 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, 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.
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] 24+ messages in thread* Re: [PATCH 11/11] contrib/plugins: add empty cpp plugin
2025-12-31 7:34 ` [PATCH 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
@ 2025-12-31 15:39 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-31 15:39 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Alex Bennée, Gustavo Bueno Romero, Daniel P. Berrangé,
Manos Pitsidianakis, Paolo Bonzini, Richard Henderson
On 31/12/25 08:34, Pierrick Bouvier 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.
>
> 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
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 00/11] plugins: enable C++ plugins
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (10 preceding siblings ...)
2025-12-31 7:34 ` [PATCH 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
@ 2026-01-02 10:35 ` Alex Bennée
2026-01-02 18:36 ` Pierrick Bouvier
2026-01-02 21:49 ` Pierrick Bouvier
12 siblings, 1 reply; 24+ messages in thread
From: Alex Bennée @ 2026-01-02 10:35 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: qemu-devel, Phil Mathieu-Daudé, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, rowan Hart
Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
> 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.
I don't have any fundamental objection to allowing this - as you say it
keep the existing API and just makes it easier for the plugin authors to
use C++.
It would be interesting to see if there are any other changes that would
also be useful for other language bindings. I suspect the most relevant
would be Rust bindings for the plugins.
>
> CI: https://gitlab.com/pbo-linaro/qemu/-/pipelines/2239199381
>
> 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++
> include: qemu/ctype.h -> qemu/qemu-ctype.h
> include: qemu/coroutine.h -> qemu/qemu-coroutine.h
> 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
>
> meson.build | 24 ++--
> block/parallels.h | 2 +-
> block/qcow2.h | 2 +-
> fsdev/qemu-fsdev-throttle.h | 2 +-
> hw/9pfs/9p.h | 2 +-
> include/block/block-global-state.h | 2 +-
> include/block/block-hmp-cmds.h | 2 +-
> include/block/block-io.h | 2 +-
> include/block/reqlist.h | 2 +-
> include/block/throttle-groups.h | 2 +-
> include/qemu/coroutine_int.h | 2 +-
> include/qemu/job.h | 2 +-
> .../qemu/{coroutine.h => qemu-coroutine.h} | 0
> include/qemu/{ctype.h => qemu-ctype.h} | 0
> include/qemu/qemu-plugin.h | 8 ++
> migration/migration.h | 2 +-
> ui/console-priv.h | 2 +-
> block.c | 2 +-
> block/block-copy.c | 2 +-
> block/io_uring.c | 2 +-
> block/linux-aio.c | 2 +-
> block/mirror.c | 2 +-
> block/progress_meter.c | 2 +-
> block/ssh.c | 2 +-
> block/vdi.c | 2 +-
> block/vvfat.c | 2 +-
> chardev/char.c | 2 +-
> gdbstub/gdbstub.c | 2 +-
> hw/9pfs/coth.c | 2 +-
> hw/block/virtio-blk.c | 2 +-
> hw/core/bus.c | 2 +-
> hw/core/qdev-properties-system.c | 2 +-
> hw/core/qdev-properties.c | 2 +-
> hw/hyperv/syndbg.c | 2 +-
> hw/nvme/nguid.c | 2 +-
> hw/s390x/ccw-device.c | 2 +-
> hw/s390x/ipl.c | 2 +-
> hw/s390x/s390-virtio-ccw.c | 2 +-
> hw/scsi/scsi-generic.c | 2 +-
> migration/migration.c | 2 +-
> migration/rdma.c | 2 +-
> monitor/fds.c | 2 +-
> monitor/hmp.c | 2 +-
> nbd/client-connection.c | 2 +-
> net/colo-compare.c | 2 +-
> net/net.c | 2 +-
> net/tap-solaris.c | 2 +-
> {contrib/plugins => plugins}/win32_linker.c | 0
> qapi/qapi-util.c | 2 +-
> qapi/qmp-dispatch.c | 2 +-
> qobject/json-parser.c | 2 +-
> target/ppc/ppc-qmp-cmds.c | 2 +-
> target/riscv/cpu.c | 2 +-
> target/riscv/riscv-qmp-cmds.c | 2 +-
> tests/qtest/libqtest.c | 2 +-
> tests/qtest/migration/migration-util.c | 2 +-
> tests/unit/test-aio-multithread.c | 2 +-
> tests/vhost-user-bridge.c | 2 +-
> ui/console.c | 2 +-
> ui/keymaps.c | 2 +-
> ui/ui-qmp-cmds.c | 2 +-
> util/cutils.c | 2 +-
> util/id.c | 2 +-
> util/qemu-co-shared-resource.c | 2 +-
> util/qemu-co-timeout.c | 2 +-
> util/qemu-coroutine-io.c | 2 +-
> util/readline.c | 2 +-
> util/thread-pool.c | 2 +-
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++
> contrib/plugins/meson.build | 25 ++--
> plugins/meson.build | 15 ++-
> qga/vss-win32/requester.cpp | 6 +-
> tests/tcg/plugins/meson.build | 18 +--
> 73 files changed, 237 insertions(+), 104 deletions(-)
> rename include/qemu/{coroutine.h => qemu-coroutine.h} (100%)
> rename include/qemu/{ctype.h => qemu-ctype.h} (100%)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
> create mode 100644 contrib/plugins/cpp.cpp
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 00/11] plugins: enable C++ plugins
2026-01-02 10:35 ` [PATCH 00/11] plugins: enable C++ plugins Alex Bennée
@ 2026-01-02 18:36 ` Pierrick Bouvier
0 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 18:36 UTC (permalink / raw)
To: Alex Bennée
Cc: qemu-devel, Phil Mathieu-Daudé, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson, rowan Hart
On 1/2/26 2:35 AM, Alex Bennée wrote:
> Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
>
>> 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.
>
> I don't have any fundamental objection to allowing this - as you say it
> keep the existing API and just makes it easier for the plugin authors to
> use C++.
>
Sounds good, thanks Alex.
> It would be interesting to see if there are any other changes that would
> also be useful for other language bindings. I suspect the most relevant
> would be Rust bindings for the plugins.
>
It would be an interesting topic, and I feel that the right way to
provide Rust support would be to offer a new API (using existing C one
internally) embracing its philosophy, instead of direct bindings to the
existing C API. Some people already explored this and it could be a
great source of inspiration:
https://github.com/qemu-rs/qemu-rs
It's definitely out of the scope for current series and C++ support though.
Pierrick
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 00/11] plugins: enable C++ plugins
2025-12-31 7:33 [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
` (11 preceding siblings ...)
2026-01-02 10:35 ` [PATCH 00/11] plugins: enable C++ plugins Alex Bennée
@ 2026-01-02 21:49 ` Pierrick Bouvier
12 siblings, 0 replies; 24+ messages in thread
From: Pierrick Bouvier @ 2026-01-02 21:49 UTC (permalink / raw)
To: qemu-devel
Cc: Phil Mathieu-Daudé, Alex Bennée, Gustavo Bueno Romero,
Daniel P. Berrangé, Manos Pitsidianakis, Paolo Bonzini,
Richard Henderson
On 12/30/25 11:33 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/2239199381
>
> 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++
> include: qemu/ctype.h -> qemu/qemu-ctype.h
> include: qemu/coroutine.h -> qemu/qemu-coroutine.h
> 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
>
> meson.build | 24 ++--
> block/parallels.h | 2 +-
> block/qcow2.h | 2 +-
> fsdev/qemu-fsdev-throttle.h | 2 +-
> hw/9pfs/9p.h | 2 +-
> include/block/block-global-state.h | 2 +-
> include/block/block-hmp-cmds.h | 2 +-
> include/block/block-io.h | 2 +-
> include/block/reqlist.h | 2 +-
> include/block/throttle-groups.h | 2 +-
> include/qemu/coroutine_int.h | 2 +-
> include/qemu/job.h | 2 +-
> .../qemu/{coroutine.h => qemu-coroutine.h} | 0
> include/qemu/{ctype.h => qemu-ctype.h} | 0
> include/qemu/qemu-plugin.h | 8 ++
> migration/migration.h | 2 +-
> ui/console-priv.h | 2 +-
> block.c | 2 +-
> block/block-copy.c | 2 +-
> block/io_uring.c | 2 +-
> block/linux-aio.c | 2 +-
> block/mirror.c | 2 +-
> block/progress_meter.c | 2 +-
> block/ssh.c | 2 +-
> block/vdi.c | 2 +-
> block/vvfat.c | 2 +-
> chardev/char.c | 2 +-
> gdbstub/gdbstub.c | 2 +-
> hw/9pfs/coth.c | 2 +-
> hw/block/virtio-blk.c | 2 +-
> hw/core/bus.c | 2 +-
> hw/core/qdev-properties-system.c | 2 +-
> hw/core/qdev-properties.c | 2 +-
> hw/hyperv/syndbg.c | 2 +-
> hw/nvme/nguid.c | 2 +-
> hw/s390x/ccw-device.c | 2 +-
> hw/s390x/ipl.c | 2 +-
> hw/s390x/s390-virtio-ccw.c | 2 +-
> hw/scsi/scsi-generic.c | 2 +-
> migration/migration.c | 2 +-
> migration/rdma.c | 2 +-
> monitor/fds.c | 2 +-
> monitor/hmp.c | 2 +-
> nbd/client-connection.c | 2 +-
> net/colo-compare.c | 2 +-
> net/net.c | 2 +-
> net/tap-solaris.c | 2 +-
> {contrib/plugins => plugins}/win32_linker.c | 0
> qapi/qapi-util.c | 2 +-
> qapi/qmp-dispatch.c | 2 +-
> qobject/json-parser.c | 2 +-
> target/ppc/ppc-qmp-cmds.c | 2 +-
> target/riscv/cpu.c | 2 +-
> target/riscv/riscv-qmp-cmds.c | 2 +-
> tests/qtest/libqtest.c | 2 +-
> tests/qtest/migration/migration-util.c | 2 +-
> tests/unit/test-aio-multithread.c | 2 +-
> tests/vhost-user-bridge.c | 2 +-
> ui/console.c | 2 +-
> ui/keymaps.c | 2 +-
> ui/ui-qmp-cmds.c | 2 +-
> util/cutils.c | 2 +-
> util/id.c | 2 +-
> util/qemu-co-shared-resource.c | 2 +-
> util/qemu-co-timeout.c | 2 +-
> util/qemu-coroutine-io.c | 2 +-
> util/readline.c | 2 +-
> util/thread-pool.c | 2 +-
> contrib/plugins/cpp.cpp | 119 ++++++++++++++++++
> contrib/plugins/meson.build | 25 ++--
> plugins/meson.build | 15 ++-
> qga/vss-win32/requester.cpp | 6 +-
> tests/tcg/plugins/meson.build | 18 +--
> 73 files changed, 237 insertions(+), 104 deletions(-)
> rename include/qemu/{coroutine.h => qemu-coroutine.h} (100%)
> rename include/qemu/{ctype.h => qemu-ctype.h} (100%)
> rename {contrib/plugins => plugins}/win32_linker.c (100%)
> create mode 100644 contrib/plugins/cpp.cpp
>
v2 sent:
https://lore.kernel.org/qemu-devel/20260102214724.4128196-1-pierrick.bouvier@linaro.org/T/#t
^ permalink raw reply [flat|nested] 24+ messages in thread