[libvirt] Adding VirtualBox support to libvirt

Pritesh Kothari Pritesh.Kothari at Sun.COM
Thu Feb 26 16:00:47 UTC 2009


Hi Daniel,

> As of 0.6.0, the libvirtd daemon is fully multi-threaded. This means
> that many API calls can be using your driver concurrently. So every
> driver API call you have (ie those registered in the 'virDriver' struct
> must use one or more mutexs to ensure safe access to internal state.

thanks, i will do the same for virtualbox driver.

>
> > I am using dlopen() and friends to open the VirtualBox library at
> > runtime, is it ok? cause I didn't see any driver doing something like
> > this.
>
> I think it depends on exactly how you are doing it - best to just post the
> patches and we can discuss whether it looks reasonable then. Why did you
> dlopen() instead of just linking to it directly ?

Basically my code depends on three libraries used in virtualbox namely: 
VBoxXPCOMC.so, VBoxRT.so, VBoxXPCOM.so and if i link to them then these
dependencies would trickle down to other programs as well, for example:
virsh would need to be relinked, for that matter any program who depends on 
libvirt with virtualbox support compiled in it would need to be relinked. so 
currently i am trying to make as minimal change to any of the libvirt files 
as possible and restrict my code to the following 6 files: vbox_driver.c/h 
and vbox_conf.c/h. I am not sure if this approach is valid?

Also I am not sure when or how should I call the driver mature enough to post 
it on the list? (like do you have any specific functions required)
I have almost all the basic functionality for listing/suspending/resuming 
domains up and running.

Regards,
-pritesh

>
> Regards,
> Daniel




More information about the libvir-list mailing list