[libvirt] [PATCH 4/4] qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull

Peter Krempa pkrempa at redhat.com
Mon Sep 30 14:28:08 UTC 2019


On Mon, Sep 30, 2019 at 16:22:34 +0200, Michal Privoznik wrote:
> On 9/27/19 3:05 PM, Peter Krempa wrote:
> > Use VIR_AUTORELEASE instead.
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >   src/qemu/qemu_driver.c | 8 +++-----
> >   1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> > index 0988071708..ed59e64c10 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c
> > @@ -18911,21 +18911,19 @@ static int
> >   qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth,
> >                       unsigned int flags)
> >   {
> > -    virDomainObjPtr vm;
> > +    VIR_AUTORELEASE(virDomainObjPtr) vm = NULL;
> > +
> >       virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1);
> > 
> >       if (!(vm = qemuDomObjFromDomain(dom)))
> >           return -1;
> > 
> > -    if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) {
> > -        virDomainObjEndAPI(&vm);
> > +    if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0)
> >           return -1;
> > -    }
> > 
> >       if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0) {
> >           virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> >                          _("cannot perform block pull while checkpoint exists"));
> > -        virDomainObjEndAPI(&vm);
> >           return -1;
> >       }
> > 
> 
> This needs to be rebased. But also, you've missed one virDomainObjEndAPI() at the end. This patch needs to look like this:

Yes as I've pushed the other patches now. Also I'm not really sure I
want to go ahead with any other VIR_AUTO things since we'll be
converting them to glib afterwards.




More information about the libvir-list mailing list