[vdsm] VDSM API/clientIF instance design issue

Dan Kenigsberg danken at redhat.com
Wed May 30 15:01:47 UTC 2012


On Wed, May 30, 2012 at 10:49:29PM +0800, Mark Wu wrote:
> Hi Guys,
> 
> Recently,  I has been working on integrate MOM into VDSM.  MOM needs
> to use VDSM API to interact with it.  But currently, it requires the
> instance of clientIF to use vdsm API.  Passing clientIF to MOM is
> not a good choice since it's a vdsm internal object.  So I try to
> remove the parameter 'cif' from the interface definition and change
> to access the globally unique  clientIF instance in API.py.

Please remind me - why don't we continue to pass the clientIF instance,
even if it means mentioning it each and every time an API.py object is
created? It may be annoying (and thus serve as a reminder that we should
probably retire much of clientIF...), but it should work.

> 
> To get the instance of clientIF,  I add a decorator to clientIF to
> change it into singleton. Actually, clientIF has been working as a
> global single instance already.  We just don't have an interface to
> get it and so passing it as parameter instead.  I think using
> singleton to get the instance of clientIF is more clean.
> 
> Dan and Saggi already gave some comments in
> http://gerrit.ovirt.org/#change,4839  Thanks for the reviewing!  But
> I think we need more discussion on it,  so I post it here because
> gerrit is not the appropriate to discuss a design issue.
> 
> Thanks !
> Mark.
> 


More information about the vdsm-devel mailing list