[libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

Dawid Zamirski dzamirski at datto.com
Tue Oct 11 19:44:45 UTC 2016


On Tue, 2016-10-11 at 10:58 -0400, Dawid Zamirski wrote:
> On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote:
> > On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote:
>> 
> > I don't understand how vbox works, but if initializing
> > g_pVBoxGlobalData
> > does not make any connection, and ISession does (which would make
> > sense), we could keep the global data around and add ISession for
> > each connection.  I guess that's something you're talking about
> > below.
> 
> 
> Neither I'm super familiar with vbox internals, but your suggestion
> sounds reasonable, so I'll dive into that code in vbox source to find
> out.
> 

So after a quick glance at vbox initalization code, it seems that both
IVirtualBox and ISession are reference counted global instances
(g_VirtualBox and g_Session [1]) and both are allocated and released in
pfnComInitialize [2] and pfnComUninitialize [3]  implementation calls.
As such I won't be able to separate out ISession instances to be per-
connection while keeping global IVirtualBox reference.


[1] https://github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/maste
r/src/VBox/Main/cbinding/VBoxCAPI.cpp#L46-L49
[2] https://github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/maste
r/src/VBox/Main/cbinding/VBoxCAPI.cpp#L480-L481
[3] https://github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/maste
r/src/VBox/Main/cbinding/VBoxCAPI.cpp#L493-L502




More information about the libvir-list mailing list