[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/8] io: change the QIOTask callback signature
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH 6/8] io: change the QIOTask callback signature |
Date: |
Fri, 6 Jan 2017 12:05:49 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Thu, Jan 05, 2017 at 03:47:57PM -0600, Eric Blake wrote:
> On 01/05/2017 10:03 AM, Daniel P. Berrange wrote:
> > Currently the QIOTaskFunc signature takes an Object * for
> > the source, and an Error * for any error. We also need to
> > be able to provide a result pointer. Rather than continue
> > to add parameters to QIOTaskFunc, remove the existing
> > ones and simply pass the QIOTask object instead. This
> > has methods to access all the other data items required
> > in the callback impl.
>
> Hmmm. If you're going to change the callback signature after all, then
> is it worth considering having the callback return void* instead of the
> clunky way of passing the result pointer around, with existing callers
> updated to return NULL if they have nothing better to do? Accessing the
> error pointer through the QIOTask object seems okay, it's just the
> return type that feels clunky.
>
> But that's bike-shedding, so I'll review as written.
Per my comments in previous patch, the approach taken here was chosen
to align with GLib's GTask/GAsyncResult design more closely.
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/ :|
- Re: [Qemu-devel] [PATCH 1/8] sockets: add ability to disable DNS resolution for InetSocketAddress, (continued)
- [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