On Wed, Jun 20, 2012 at 06:08:57PM +0800, Xu He Jie wrote:
Hi, folks
I am trying move api implement to sub-module, then we don't need singleton and passing clientif to anywhere. So I sent this mail to descript the idea. I think it's good for review.
So I add api registeration mechanism. Other modules can register it's api implement to api layer. I try to move VM api and vm stuff(like clientif.vmContainer, etc) to a new module called vmm. the vmm.VMM is similar with hsm. It's responsiable for managing vm and register VM implement to api layer. Same with hsm, I move all storage related api to hsm, and hsm will register them to api layer.
After all api move to submodule, we can rename clientif and needn't passing client to any where. :)
I have already submit a rough version to gerrit: http://gerrit.ovirt.org/#/q/status:open+project:vdsm+branch:master+topic:wip...
I took a cursory look at the code you have submitted. I think you need to more thoroughly describe your design. I was particularly confused by your use of Abstract Base Classes for this scenario. Can you explain in more depth why you have done this? Is there a simpler way to accomplish what you need to do? I looked at your VMM patch and I am unsure why you need to define VMBase and VMImpl separately. It means declaring the set of functions in two separate files. Thanks for shining some more light on your methodology.