Re: [PATCH] qapi: enable use of g_autoptr with QAPI types

2020-07-23 Thread Daniel P . Berrangé
On Thu, Jul 23, 2020 at 02:50:51PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Thu, Jul 23, 2020 at 06:49:44AM -0500, Eric Blake wrote: > >> On 7/23/20 6:12 AM, Daniel P. Berrangé wrote: > >> > Currently QAPI generates a type and function for free'ing it: > >> > > >> >

Re: [PATCH] qapi: enable use of g_autoptr with QAPI types

2020-07-23 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Jul 23, 2020 at 06:49:44AM -0500, Eric Blake wrote: >> On 7/23/20 6:12 AM, Daniel P. Berrangé wrote: >> > Currently QAPI generates a type and function for free'ing it: >> > >> >typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; >> >

Re: [PATCH] qapi: enable use of g_autoptr with QAPI types

2020-07-23 Thread Daniel P . Berrangé
On Thu, Jul 23, 2020 at 06:49:44AM -0500, Eric Blake wrote: > On 7/23/20 6:12 AM, Daniel P. Berrangé wrote: > > Currently QAPI generates a type and function for free'ing it: > > > >typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; > >void

Re: [PATCH] qapi: enable use of g_autoptr with QAPI types

2020-07-23 Thread Eric Blake
On 7/23/20 6:12 AM, Daniel P. Berrangé wrote: Currently QAPI generates a type and function for free'ing it: typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj); The above code example now becomes

[PATCH] qapi: enable use of g_autoptr with QAPI types

2020-07-23 Thread Daniel P . Berrangé
Currently QAPI generates a type and function for free'ing it: typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj); This is used in the traditional manner: QCryptoBlockCreateOptions *opts = NULL;