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~
