Re: [PATCH v2] virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

2022-09-20 Thread Martin Kletzander
On Tue, Sep 20, 2022 at 01:10:49PM +0200, Peter Krempa wrote: On Tue, Sep 20, 2022 at 11:44:06 +0100, Daniel P. Berrangé wrote: On Tue, Sep 20, 2022 at 12:33:15PM +0200, Martin Kletzander wrote: > On Tue, Sep 20, 2022 at 11:04:39AM +0200, Peter Krempa wrote: > > The 'cb' and 'jobDataPrivateCb' p

Re: [PATCH v2] virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

2022-09-20 Thread Peter Krempa
On Tue, Sep 20, 2022 at 11:44:06 +0100, Daniel P. Berrangé wrote: > On Tue, Sep 20, 2022 at 12:33:15PM +0200, Martin Kletzander wrote: > > On Tue, Sep 20, 2022 at 11:04:39AM +0200, Peter Krempa wrote: > > > The 'cb' and 'jobDataPrivateCb' pointers are stored in the job object > > > but made point t

Re: [PATCH v2] virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

2022-09-20 Thread Daniel P . Berrangé
On Tue, Sep 20, 2022 at 12:33:15PM +0200, Martin Kletzander wrote: > On Tue, Sep 20, 2022 at 11:04:39AM +0200, Peter Krempa wrote: > > The 'cb' and 'jobDataPrivateCb' pointers are stored in the job object > > but made point to the memory owned by the virDomainXMLOption struct in > > the callers. >

Re: [PATCH v2] virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

2022-09-20 Thread Martin Kletzander
On Tue, Sep 20, 2022 at 11:04:39AM +0200, Peter Krempa wrote: The 'cb' and 'jobDataPrivateCb' pointers are stored in the job object but made point to the memory owned by the virDomainXMLOption struct in the callers. Since the 'virdomainjob' module isn't in control the lifetime of the virDomainXM

[PATCH v2] virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

2022-09-20 Thread Peter Krempa
The 'cb' and 'jobDataPrivateCb' pointers are stored in the job object but made point to the memory owned by the virDomainXMLOption struct in the callers. Since the 'virdomainjob' module isn't in control the lifetime of the virDomainXMLOption, which in some cases is freed before the domain job data