[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/8] io: add ability to associate an opaque "res
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH 4/8] io: add ability to associate an opaque "result" with with a task |
Date: |
Fri, 6 Jan 2017 09:14:43 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Thu, Jan 05, 2017 at 02:32:46PM -0600, Eric Blake wrote:
> On 01/05/2017 10:03 AM, Daniel P. Berrange wrote:
> > Currently there is no data associated with a successful
> > task completion. This adds an opaque pointer to the task
> > to store an arbitrary result.
> >
> > Signed-off-by: Daniel P. Berrange <address@hidden>
> > ---
> > include/io/task.h | 27 +++++++++++++++++++++++++++
> > io/task.c | 20 ++++++++++++++++++++
> > 2 files changed, 47 insertions(+)
> >
>
> I suppose a different approach would have been changing QIOTaskFunc() to
> have a void* return, but that would be more invasive. Grabbing the
> result separately from the task completing is a bit weird, but looks
> like it will work.
FYI, the design I've chosen here closely matches that used by GLib in its
own GTask / GAsyncResult, on which the QIOTask was modelled. The idea is
that in future when we eventually bump to a newer glib, we can switch
over to GTask easily.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
- [Qemu-devel] [PATCH 0/8] io: enable DNS resolving separately of socket create, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 2/8] io: stop incrementing reference in qio_task_get_source, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 3/8] io: fix typo in docs for QIOTask, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 1/8] sockets: add ability to disable DNS resolution for InetSocketAddress, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 4/8] io: add ability to associate an opaque "result" with with a task, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 5/8] io: add ability to associate an error with a task, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 6/8] io: change the QIOTask callback signature, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 8/8] io: introduce a DNS resolver API, Daniel P. Berrange, 2017/01/05
- [Qemu-devel] [PATCH 7/8] io: remove Error parameter from QIOTask thread worker, Daniel P. Berrange, 2017/01/05