From: "Alex Bennée" <alex.bennee@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: qemu-devel@nongnu.org, "Phil Mathieu-Daudé" <philmd@linaro.org>,
"Gustavo Bueno Romero" <gustavo.romero@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"rowan Hart" <rowanbhart@gmail.com>
Subject: Re: [PATCH 00/11] plugins: enable C++ plugins
Date: Fri, 02 Jan 2026 10:35:09 +0000 [thread overview]
Message-ID: <87h5t4xpya.fsf@draig.linaro.org> (raw)
In-Reply-To: <20251231073401.2097765-1-pierrick.bouvier@linaro.org> (Pierrick Bouvier's message of "Tue, 30 Dec 2025 23:33:50 -0800")
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
next prev parent reply other threads:[~2026-01-02 10:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` [PATCH 03/11] plugins: use complete filename for defining plugins sources 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
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
2026-01-02 5:11 ` Paolo Bonzini
2026-01-02 6:17 ` Pierrick Bouvier
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
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é
2025-12-31 7:33 ` [PATCH 08/11] meson: enable cpp (optionally) for plugins 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
2025-12-31 7:34 ` [PATCH 10/11] meson: update C++ standard to C++23 Pierrick Bouvier
2025-12-31 7:34 ` [PATCH 11/11] contrib/plugins: add empty cpp plugin Pierrick Bouvier
2025-12-31 15:39 ` Philippe Mathieu-Daudé
2026-01-02 10:35 ` Alex Bennée [this message]
2026-01-02 18:36 ` [PATCH 00/11] plugins: enable C++ plugins Pierrick Bouvier
2026-01-02 21:49 ` Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h5t4xpya.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=gustavo.romero@linaro.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rowanbhart@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.