Re: [PATCH 5/5] util: Replace virStorageSourceFree with virObjectUnref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 18, 2019 at 07:15:38 -0500, John Ferlan wrote:
> 
> 
> On 2/15/19 7:42 AM, Peter Krempa wrote:
> > Now that virStorageSource is a subclass of virObject we can use
> > virObjectUnref and remove virStorageSourceFree which was a thin wrapper.
> > 
> > Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> > ---
> >  src/conf/domain_conf.c     |  8 ++++----
> >  src/conf/snapshot_conf.c   |  2 +-
> >  src/libvirt_private.syms   |  1 -
> >  src/qemu/qemu_blockjob.c   | 10 +++++-----
> >  src/qemu/qemu_domain.c     |  2 +-
> >  src/qemu/qemu_driver.c     |  6 +++---
> >  src/qemu/qemu_hotplug.c    |  2 +-
> >  src/qemu/qemu_migration.c  |  2 +-
> >  src/storage/storage_util.c |  2 +-
> >  src/util/virstoragefile.c  | 35 ++++++++++++++---------------------
> >  src/util/virstoragefile.h  |  1 -
> >  tests/virstoragetest.c     |  4 ++--
> >  12 files changed, 33 insertions(+), 42 deletions(-)
> > 
> 
> [...]
> 
> > diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> > index 56c6510c5e..9dd27b5ca6 100644
> > --- a/src/util/virstoragefile.c
> > +++ b/src/util/virstoragefile.c
> > @@ -1133,7 +1133,7 @@ virStorageFileMetadataNew(const char *path,
> >      return def;
> > 
> >   error:
> > -    virStorageSourceFree(def);
> > +    virObjectUnref(def);
> 
> Is this right?  @def is VIR_ALLOC'd and not virStorageSourceNew alloc'd.
> Also anything that calls this would have the same problem I would think.

No. virStorageSource now must be allocated using virStorageSourceNew.
The first patch missed fixing this instance.

I'll post a patch soon.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux