[Top][All Lists]

[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.

|: 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/ :|

reply via email to

[Prev in Thread] Current Thread [Next in Thread]