[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/14] qio: refcount QIOTask
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH 10/14] qio: refcount QIOTask |
Date: |
Wed, 28 Feb 2018 13:07:44 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Wed, Feb 28, 2018 at 08:54:00PM +0800, Peter Xu wrote:
> On Wed, Feb 28, 2018 at 09:16:59AM +0000, Daniel P. Berrangé wrote:
> > On Wed, Feb 28, 2018 at 01:06:29PM +0800, Peter Xu wrote:
> > > It will be used in multiple threads in follow-up patches. Let it start
> > > to have refcounts.
> > >
> > > Signed-off-by: Peter Xu <address@hidden>
> > > ---
> > > include/io/task.h | 3 +++
> > > io/task.c | 23 ++++++++++++++++++++++-
> > > 2 files changed, 25 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/include/io/task.h b/include/io/task.h
> > > index 9dbe3758d7..c6acd6489c 100644
> > > --- a/include/io/task.h
> > > +++ b/include/io/task.h
> > > @@ -322,4 +322,7 @@ gpointer qio_task_get_result_pointer(QIOTask *task);
> > > */
> > > Object *qio_task_get_source(QIOTask *task);
> > >
> > > +void qio_task_ref(QIOTask *task);
> > > +void qio_task_unref(QIOTask *task);
> >
> > It should just be turned back into a QObject as it was originally,
> > so we get refcounting for free.
>
> Could you point me the commit that has the original code? I would be
> glad to revert to that, or yeah I can switch to QObject too. Thanks,
It was never actually committed - it was just that way during initial
review but was suggested to be simplified as ref counting wasn't needed.
That all said, having now seen the later parts of this patch series, I
don't think we would need todo this at all, because we should not be
exposing the GTask to callers and thus the refcounting question goes away
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PATCH 06/14] qio: store gsources for net listeners, (continued)
- [Qemu-devel] [PATCH 06/14] qio: store gsources for net listeners, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 07/14] qio/chardev: update net listener gcontext, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 08/14] chardev: allow telnet gsource to switch gcontext, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 09/14] qio: basic non-default context support for thread, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 10/14] qio: refcount QIOTask, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 11/14] qio/chardev: return QIOTask when connect async, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 12/14] qio: move QIOTaskThreadData into QIOTask, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 13/14] qio: allow threaded qiotask to switch contexts, Peter Xu, 2018/02/28
- [Qemu-devel] [PATCH 14/14] qio/chardev: specify gcontext for TLS handshake, Peter Xu, 2018/02/28