2011/5/13 Eric Blake <eblake@xxxxxxxxxx>: > On 05/01/2011 01:57 PM, Matthias Bolte wrote: >> Don't make all object and enum types (de)serializable by default. >> Detect this from the input file instead. >> --- >> Âsrc/esx/esx_vi_generator.py | Â167 +++++++++++++++++++++++++++++++----------- >> Â1 files changed, 123 insertions(+), 44 deletions(-) > > Too bad generated files don't show up in the diffstat :) > >> +# there are two directions to spread features: >> +# 1) up and down the inheritance chain >> +# 2) from object types to their member property types >> +# spreading needs to be done alternating on both directions because they can >> +# affect each other >> +features_have_changed = True >> + >> +while features_have_changed: >> + Â Âfeatures_have_changed = False >> + >> + Â Âfor obj in objects_by_name.values(): >> + Â Â Â Âpropagate_feature(obj, Object.FEATURE__DEEP_COPY) >> + Â Â Â Âpropagate_feature(obj, Object.FEATURE__SERIALIZE) >> + Â Â Â Âpropagate_feature(obj, Object.FEATURE__DESERIALIZE) >> + >> + Â Âfor obj in objects_by_name.values(): >> + Â Â Â Âinherit_features(obj) > > If I'm reading this correctly, this looks like the core of the algorithm > - compute a closure of all features, and then only generate for where > the features were needed, rather than the old code that generated > features for everything whether it was needed or not. Yes, that's correct :) > My python is not very strong, but what you did was fairly readable and > seems to make sense. ÂAt any rate, it compiles. > > ACK. > Thanks, pushed. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list