> Date: Wed, 1 May 2013 14:27:08 +0200
> Subject: Re: [libvirt] [PATCH] ESX: Fix DISPATCH_FREE generation code to free all extended objects
> From: matthias.bolte@googlemail.com
> To: ata.husain@hotmail.com
> CC: libvir-list@redhat.com
>
> 2013/1/2 Ata E Husain Bohra <ata.husain@hotmail.com>:
> > Python code generator "generate_source" section that handles
> > code generation to "free" inherited objects needs to generate
> > DISPATCH_FREE calls for all extended_by objects.
> > ---
> > src/esx/esx_vi_generator.py | 21 ++++++++++++++++++---
> > 1 file changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
> > index af4e7e8..7a7cf76 100755
> > --- a/src/esx/esx_vi_generator.py
> > +++ b/src/esx/esx_vi_generator.py
> > @@ -4,6 +4,7 @@
> > # esx_vi_generator.py: generates most of the SOAP type mapping code
> > #
> > # Copyright (C) 2010-2012 Matthias Bolte <matthias.bolte@googlemail.com>
> > +# Copyright (C) 2013 Ata E Husain Bohra <ata.husain@hotmail.com>
> > #
> > # This library is free software; you can redistribute it and/or
> > # modify it under the terms of the GNU Lesser General Public
> > @@ -785,9 +786,7 @@ class Object(Type):
> > source += "ESX_VI__TEMPLATE__DYNAMIC_FREE(%s,\n" % self.name
> > source += "{\n"
> >
> > - for extended_by in self.extended_by:
> > - source += " ESX_VI__TEMPLATE__DISPATCH__FREE(%s)\n" \
> > - % extended_by
> > + source += recurse_dispatch(self, "ESX_VI__TEMPLATE__DISPATCH__FREE")
> >
> > source += "},\n"
> > source += "{\n"
>
> ACK for the general idea of the fix, but there is already a
> generate_dispatch function that does what you reimplemented in
> recurse_dispatch.
>
> I removed recurse_dispatch, replaced the call to it with a call to
> generate_dispatch and pushed the result.
>
> --
> Matthias Bolte
> http://photron.blogspot.com