This patch series solves (at least in my testing) vbox driver
thread-safety issues that were also outlined on libvirt-users ML [1]
and I was affected with. Those patches try to follow the suggestions
made Matthias' [2] in that thread as close as possible. Here's where
my patch differs from that suggesions:
* vboxGlobalData - still needs to keep reference to ISession and
IVirutalBox session because it's apparently not possible to have
multiple instances created/destroyed safely with pfnComInitialize
and pfnComUninitalize calls on per-connection basis.
* as such vboxPrivate (the new struct introduced here) also has
references to ISession and IVirutalBox (which are just referenes to
the ones from the global) mainly to immitate ISession instance
per-connection. Apparently newer VBOX SDKs introduced
pfnClinetInitialize that can allegedly create multiple ISessions and
we might want to take advantage of that in the future hopefully
without making additional changes allover the driver code that this
patch did.
The gist of the change is in patch 3 and it also contains more
in-depth explanation on how the issue is being resolved. Also, please
note that patch 4 should be squashed into 3 as it was kept separate
only for code-review purposes and 3rd patch won't compile without 4
applied on top.
[1]
https://www.redhat.com/archives/libvirt-users/2012-April/msg00122.html
[2]
https://www.redhat.com/archives/libvirt-users/2012-April/msg00125.htmlgq
Dawid Zamirski (4):
vbox: add vboxPrivate struct.
vbox: replace vboxGlobalData with vboxPrivate.
vbox: change API (un)initialization logic.
vbox: update rest of the code to for prior changes.
src/vbox/vbox_common.c | 275 ++++++++++++---------------
src/vbox/vbox_common.h | 32 ++--
src/vbox/vbox_network.c | 51 +++--
src/vbox/vbox_storage.c | 20 +-
src/vbox/vbox_tmpl.c | 433 +++++++++++++++++++++---------------------
src/vbox/vbox_uniformed_api.h | 128 +++++++------
6 files changed, 460 insertions(+), 479 deletions(-)
--
2.7.4