[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async op
|
From: |
Paolo Bonzini |
|
Subject: |
Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations |
|
Date: |
Fri, 17 Apr 2015 17:16:26 +0200 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 17/04/2015 16:22, Daniel P. Berrange wrote:
> A number of I/O operations need to be performed asynchronously
> to avoid blocking the main loop. The caller of such APIs need
> to provide a callback to be invoked on completion/error and
> need access to the error, if any. The small QIOTask provides
> a simple framework for dealing with such probes. The API
> docs inline provide an outline of how this is to be used.
>
> In this series, the QIOTask class will be used for things like
> the TLS handshake, the websockets handshake and TCP connect()
> progress.
Is this actually worth making it a heavyweight QOM object? In general
if you don't do object_property_add_child (and I don't think here you
do), it's simpler to just make it a C struct.
In this case I even think you're leaking the task. You do object_ref
twice (once at creation time, once before qio_channel_add_watch_full)
and only have one object_unref. I would just do without reference
counting, and add a qio_task_free() function that calls
qio_task_finalize() and frees the QIOTask.
BTW, do you have plans to use the GDestroyNotify argument to
qio_task_new, or is it just for consistency?
Paolo
- [Qemu-devel] [PATCH v1 RFC 19/34] block: convert qcow/qcow2 to use generic cipher API, (continued)
- [Qemu-devel] [PATCH v1 RFC 19/34] block: convert qcow/qcow2 to use generic cipher API, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 21/34] io: add abstract QIOChannel classes, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 20/34] ui: convert VNC to use generic cipher API, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 22/34] io: add helper module for creating watches on UNIX FDs, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 24/34] io: add QIOChannelFile class, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 23/34] io: add QIOChannelSocket class, Daniel P. Berrange, 2015/04/17
- [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Daniel P. Berrange, 2015/04/17
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Daniel P. Berrange, 2015/04/17
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Paolo Bonzini, 2015/04/17
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Daniel P. Berrange, 2015/04/17
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Paolo Bonzini, 2015/04/17
- Re: [Qemu-devel] [PATCH v1 RFC 25/34] io: add QIOTask class for async operations, Daniel P. Berrange, 2015/04/17
[Qemu-devel] [PATCH v1 RFC 26/34] io: add QIOChannelTLS class, Daniel P. Berrange, 2015/04/17
[Qemu-devel] [PATCH v1 RFC 28/34] io: add QIOChannelWebsock class, Daniel P. Berrange, 2015/04/17
[Qemu-devel] [PATCH v1 RFC 30/34] ui: convert VNC server to use QIOChannelTLS, Daniel P. Berrange, 2015/04/17
[Qemu-devel] [PATCH v1 RFC 31/34] ui: convert VNC server to use QIOChannelWebsock, Daniel P. Berrange, 2015/04/17
[Qemu-devel] [PATCH v1 RFC 32/34] char: convert from GIOChannel to QIOChannel, Daniel P. Berrange, 2015/04/17