On Thu, 2019-10-17 at 17:08 -0300, Daniel Henrique Barboza wrote: > > On 10/17/19 5:03 PM, Jonathon Jongsma wrote: > > On Thu, 2019-10-17 at 09:46 -0300, Daniel Henrique Barboza wrote: > > > Change all feasible pointers to use g_autoptr(). > > > > > > Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> > > > --- > > > src/qemu/qemu_process.c | 121 +++++++++++++------------------ > > > ------- > > > -- > > > 1 file changed, 40 insertions(+), 81 deletions(-) > > > > > > diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c > > > index f747cdcc59..6ed69bef27 100644 > > > --- a/src/qemu/qemu_process.c > > > +++ b/src/qemu/qemu_process.c > > > @@ -108,7 +108,7 @@ > > > qemuProcessRemoveDomainStatus(virQEMUDriverPtr > > > driver, > > > char ebuf[1024]; > > > g_autofree char *file = NULL; > > > qemuDomainObjPrivatePtr priv = vm->privateData; > > > - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); > > > + g_autoptr(virQEMUDriverConfig) cfg = > > > virQEMUDriverGetConfig(driver); > > > int ret = -1; > > > > > > if (virAsprintf(&file, "%s/%s.xml", cfg->stateDir, vm->def- > > > > name) < 0) > > > @@ -126,7 +126,6 @@ > > > qemuProcessRemoveDomainStatus(virQEMUDriverPtr > > > driver, > > > > > > ret = 0; > > > cleanup: > > > - virObjectUnref(cfg); > > > > It seems to me that if you're removing everything except the return > > from the "cleanup" label, there is no longer any use for the 'goto > > cleanup' statement. You can replace it with a straight return. > > There > > are quite a few similar cases below. > > This is being done in the next patch. This separation was given as a > feedback from the qemu_driver.c changes, where separating the > 'cleanup' > label removal from the auto* changes makes it easier to review. > Yep, sorry. Please excuse the noise. I was apparently a little behind on mailing list email and I both 1) replied to a slightly old version of the patch series and 2) replied before reading the full patch series. Carry on. Jonathon -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list