From: Richard Henderson <richard.henderson@linaro.org>
To: Greg Manning <gmanning@rapitasystems.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "luoyonggang@gmail.com" <luoyonggang@gmail.com>
Subject: Re: Getting qemu plugins working on windows
Date: Mon, 30 Oct 2023 11:18:37 -0700 [thread overview]
Message-ID: <1f06e3b0-1531-4f9c-9a66-1811bbba37fa@linaro.org> (raw)
In-Reply-To: <CWXP123MB43418A508D8E101ABC58A523D7A1A@CWXP123MB4341.GBRP123.PROD.OUTLOOK.COM>
On 10/30/23 09:48, Greg Manning wrote:
> Hello,
>
> Currently, qemu plugin support only works in Linux and I would like to get qemu plugins working on
> Windows. I have had some success experimenting with this locally (based on some previous work by
> Yonggang Luo, see below), but would like to gauge opinion before I commit to suggesting a solution.
>
> The overall structure of how plugins work is this:
>
> 1. qemu executable loads plugin.so.
> 2. plugin.so defines a function qemu_plugin_install, which qemu looks up, and calls.
> during that function call plugin.so might call some of the qemu_plugin_* functions that the host
> executable has implementations of. plugin.so is compiled with unresolved references to these functions,
> and they get linked up at dll load time.
>
> Windows doesn't let you do such on-the-fly load time linking. You need a dll import library, which is
> specific to a particular host executable. The qemu project, however, has many executables, any
> of which might want to load a given plugin.
>
> Possible ways to get things working on Windows:
>
> 1. Make the dll import library. Possibly refactor the qemu plugin code into a single qemu_plugin.{so,dll},
> and then make the import library for that. I don't fully understand this system, and I'm still concerned
> it would be fragile (if qemu is recompiled, do I need to recompile all my plugins against the new
> version of the import library?)
As we work toward a single qemu executable, I expect that we will need to build most of
qemu as a dll, and then you'd have exactly the image against which plugins could be linked.
This is probably still a couple of releases away from daylight, but I wouldn't want too
much work to be done on an alternate method for Windows in the meantime.
r~
prev parent reply other threads:[~2023-10-30 18:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 16:48 Getting qemu plugins working on windows Greg Manning
2023-10-30 18:18 ` Richard Henderson [this message]
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=1f06e3b0-1531-4f9c-9a66-1811bbba37fa@linaro.org \
--to=richard.henderson@linaro.org \
--cc=gmanning@rapitasystems.com \
--cc=luoyonggang@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).