All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/9] Clear fd handlers
Date: Tue, 09 Mar 2010 17:58:59 -0600	[thread overview]
Message-ID: <4B96E0C3.4070903@codemonkey.ws> (raw)
In-Reply-To: <alpine.LNX.2.00.1003100252001.5587@linmac>

On 03/09/2010 05:53 PM, malc wrote:
> On Tue, 9 Mar 2010, Juan Quintela wrote:
>
>    
>> Hi
>>
>> This series :
>> - convert io_handlers to one QLIST
>> - once there, qemu_set_fd_handlers2() has lots of arguments that are a lot of times NULL.
>>    Introduce a set of functions to not have to pass NULL values.
>>   - qemu_clear_fd_handlers(): remove it
>>   - qemu_set_fd_read_handler(): only read
>>   - qemu_set_fd_write_handler(): only write
>>   - qemu_set_fd_rw_handler(): read/write
>>   - qemu_set_fd_poll_handler(): it was only used for reads and in qemu-char.c.
>>
>> - once there fix bt that don't need poll at all (having a poll function that always return true
>>    is the equivalent of not having one).
>> - remove cast to (void *)(unsigned long) for things that already were pointers
>> - IOCanRWHandler is only used for reads ->  rename it (almost no users).
>>
>> ToDo:
>> - to remove the export of qemu_set_fd_handlers2() we need a solution for tap.
>>    Tap is the only user in qemu that uses poll, read and write, and it changes in very imaginative
>>    ways:
>>      qemu_set_fd_handler2(s->fd,
>>                           s->read_poll  ? tap_can_send : NULL,
>>                           s->read_poll  ? tap_send     : NULL,
>>                           s->write_poll ? tap_writable : NULL,
>>                           s);
>>
>>    No ideas about how to transform this into something that don't use NULL's in any of its fields
>>    other than a row of if's.
>>
>> - removal of poll function. comment of qemu_set_fd_handler2()
>>    /* XXX: fd_read_poll should be suppressed, but an API change is
>>      necessary in the character devices to suppress fd_can_read(). */
>>
>>    But qemu-char.c is a complex beast, and would preffer to 1st get this patches in, and then
>>    work on the other stuff.
>>
>> - obvious optimization now is to have the FD_SET() for write/read already filled, but I
>>    haven't done any meassurement.
>>
>> Comments?
>>
>> Juan Quintela (9):
>>    Convert io handlers to QLIST
>>    Introduce qemu_clear_fd_handler()
>>    Introduce qemu_set_fd_read_handler()
>>    Introduce qemu_set_fd_write_handler()
>>    Introduce qemu_set_fd_rw_handler()
>>    bt: remove bt_host_read_poll()
>>    Introduce qemu_set_fd_poll_handler()
>>    remove useless cast
>>    rename IOCanRWHandler to IOCanReadHandler
>>
>>   aio.c               |    2 +-
>>   audio/alsaaudio.c   |   12 +++---
>>   audio/ossaudio.c    |   10 ++--
>>   bt-host.c           |    9 +----
>>   bt-vhci.c           |    2 +-
>>   hw/baum.c           |    2 +-
>>   hw/xen_backend.c    |   10 ++--
>>   migration-exec.c    |    8 ++--
>>   migration-fd.c      |    5 +-
>>   migration-tcp.c     |   10 ++--
>>   migration-unix.c    |   10 ++--
>>   migration.c         |    8 ++--
>>   net/socket.c        |   14 +++---
>>   net/vde.c           |    4 +-
>>   qemu-aio.h          |    4 +-
>>   qemu-char.c         |   48 +++++++++++-----------
>>   qemu-char.h         |   25 ++++++++---
>>   qemu-common.h       |    2 +-
>>   qemu-tool.c         |    9 ++--
>>   usb-linux.c         |    4 +-
>>   vl.c                |  114 +++++++++++++++++++++++++++++++++++---------------
>>   vnc-auth-sasl.c     |    2 +-
>>   vnc-auth-vencrypt.c |    6 +-
>>   vnc.c               |   12 +++---
>>   24 files changed, 190 insertions(+), 142 deletions(-)
>>      
> What's the point if it ends up adding 48 lines of code?
>    

Yeah, I think this would be more interesting if it eliminated the 
can_read handlers altogether.

Regards,

Anthony Liguori

  reply	other threads:[~2010-03-09 23:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 22:25 [Qemu-devel] [PATCH 0/9] Clear fd handlers Juan Quintela
2010-03-09 22:25 ` [Qemu-devel] [PATCH 1/9] Convert io handlers to QLIST Juan Quintela
2010-03-09 22:25 ` [Qemu-devel] [PATCH 2/9] Introduce qemu_clear_fd_handler() Juan Quintela
2010-03-09 22:25 ` [Qemu-devel] [PATCH 3/9] Introduce qemu_set_fd_read_handler() Juan Quintela
2010-03-09 22:25 ` [Qemu-devel] [PATCH 4/9] Introduce qemu_set_fd_write_handler() Juan Quintela
2010-03-09 22:25 ` [Qemu-devel] [PATCH 5/9] Introduce qemu_set_fd_rw_handler() Juan Quintela
2010-03-09 22:41   ` [Qemu-devel] " Juan Quintela
2010-03-09 22:26 ` [Qemu-devel] [PATCH 6/9] bt: remove bt_host_read_poll() Juan Quintela
2010-03-09 22:26 ` [Qemu-devel] [PATCH 7/9] Introduce qemu_set_fd_poll_handler() Juan Quintela
2010-03-09 22:26 ` [Qemu-devel] [PATCH 8/9] remove useless cast Juan Quintela
2010-03-09 22:26 ` [Qemu-devel] [PATCH 9/9] rename IOCanRWHandler to IOCanReadHandler Juan Quintela
2010-03-09 23:53 ` [Qemu-devel] [PATCH 0/9] Clear fd handlers malc
2010-03-09 23:58   ` Anthony Liguori [this message]
2010-03-10  0:12     ` [Qemu-devel] " Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B96E0C3.4070903@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.