Re: [PATCH 17/36] datatypes: convert virNWFilter to GObject

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

 



On Wed, Apr 8, 2020 at 11:12 PM Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote:
>
> On Fri, 2020-04-03 at 17:15 +0200, Rafael Fonseca wrote:
> > @@ -503,14 +503,13 @@ virNWFilterGetXMLDesc(virNWFilterPtr nwfilter,
> > unsigned int flags)
> >  int
> >  virNWFilterRef(virNWFilterPtr nwfilter)
> >  {
> > -    VIR_DEBUG("nwfilter=%p refs=%d", nwfilter,
> > -              nwfilter ? nwfilter->parent.u.s.refs : 0);
> > +    VIR_DEBUG("nwfilter=%p", nwfilter);
>
> I wonder about this change. If it doesn't include the ref count in the
> debug message, is it actually still useful to anyone? I've never used
> it, so I don't know. If we want to keep it, we could of course access
> the GObject ref_count member variable.

I was looking for ways to do this in glib and this is what the doc says:

"All the fields in the GObject structure are private to the GObject
implementation and should never be accessed directly." [1]

And it seems there is no alternative other than using a weak reference
to have a callback called.

[1] https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-struct


Att.
-- 
Rafael Fonseca






[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