[Ovirt-devel] [PATCH server] Revised attempt at refactoring the vm_controller using the service layer.

Hugh O. Brock hbrock at redhat.com
Wed Apr 22 18:31:12 UTC 2009


On Wed, Apr 22, 2009 at 11:21:03AM -0700, David Lutterkort wrote:
> On Wed, 2009-04-22 at 11:06 -0700, Ian Main wrote:
> > Otherwise you have to load the VM active record and make a hash from it
> > (?? maybe that's easy?) and then call svc_update() with the new hash..
> > maybe it would be possible to just have the permission check callable
> > directly?  Not sure what is best..
> 
> Yeah, for single-property updates we want some more generic way to do
> that, on the ovirt agent side, I'd think something like
> 
>         def description(new_desc)
>           ar_id = ... from QMF objectID ...
>           user = ... QMF user ...
>           svc_property!(user, ar_id, :description, new_desc)
>         end
> 
> and have svc_property! do the permission check, load the AR model,
> change its description attribute, and save! it back.
> 
> Given how that is just a lot of boilerplate, I'd imagine that with a
> tiny bit of metaprogramming, we can reduce that to
> 
>         property_setter :description
>         
> David

Paging Dr. Jones... Dr. Jones, please bring your camel to the
operating room...

<g>

--Hugh




More information about the ovirt-devel mailing list