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

David Lutterkort lutter at redhat.com
Wed Apr 22 18:21:03 UTC 2009


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





More information about the ovirt-devel mailing list