[libvirt] [PATCH 06/11] conf: Get rid of virDomainDeviceDefPostParseOne

Peter Krempa pkrempa at redhat.com
Mon Oct 1 10:41:31 UTC 2018


On Mon, Oct 01, 2018 at 12:27:41 +0200, Marc Hartmayer wrote:
> On Sat, Sep 29, 2018 at 04:09 AM +0200, John Ferlan <jferlan at redhat.com> wrote:
> > On 9/20/18 1:44 PM, Marc Hartmayer wrote:
> >> Move the domainPostParseDataAlloc/Free calls to
> >> virDomainDeviceDefParse. As an consequence
> >> virDomainDeviceDefPostParseOne is superfluous and can therefore be
> >> removed.
> >>
> >> Signed-off-by: Marc Hartmayer <mhartmay at linux.ibm.com>
> >> Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
> >> ---
> >>  src/conf/domain_conf.c | 37 +++++++++++--------------------------
> >>  1 file changed, 11 insertions(+), 26 deletions(-)
> >>
> >
> > I'm not against this per se; however, I should not that the code was
> > specifically extracted in commit e168bc8a.
> 
> There are the following three functions:
> 
> virDomainDeviceDefParse
> virDomainDeviceDefPostParse
> virDomainDeviceDefPostParseOne
> 
> Peter introduced the function “virDomainDeviceDefPostParseOne” to avoid
> the allocation of private data across the callbacks. This is absolutely
> fine.
> 
> What I’ve done is, I moved the domainPostParseDataAlloc/Free calls to
> virDomainDeviceDefParse instead of having an extra wrapper function
> (virDomainDeviceDefPostParse/One) for that. With this change I can reuse
> the QEMU caps for the virDomainDeviceDefValidate call in
> virDomainDeviceDefParse as well.

For the above it's not necessary to open-code what virDomainDeviceDefPostParseOne
in a rather massive function. You can pass the opaque in if you want.

Please don't remove the wrapper.




More information about the libvir-list mailing list