All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/2] nbd: Coroutine based nbd_send_negotiate
Date: Mon, 11 Jan 2016 15:00:58 +0100	[thread overview]
Message-ID: <5693B59A.6040806@redhat.com> (raw)
In-Reply-To: <1452483373-22471-3-git-send-email-famz@redhat.com>



On 11/01/2016 04:36, Fam Zheng wrote:
>  
> +    aio_set_fd_handler(ctx, client->sock, true,
> +                       nbd_negotiate_continue,
> +                       nbd_negotiate_continue, data->co);
>      TRACE("Beginning negotiation.");
>      memset(buf, 0, sizeof(buf));

This causes a busy loop if the socket is writable but the client does
not send data.  I think you need to set/clear the handler (using
qemu_coroutine_self() instead of data->co, probably) every time the
direction of negotiation switches.  That is, set only a read handler
before read_sync, and only a write handler before write_sync.

Paolo

  reply	other threads:[~2016-01-11 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11  3:36 [Qemu-devel] [PATCH v2 0/2] nbd: Async built-in server negotiation Fam Zheng
2016-01-11  3:36 ` [Qemu-devel] [PATCH v2 1/2] nbd: Always call "close_fn" in nbd_client_new Fam Zheng
2016-01-11  3:36 ` [Qemu-devel] [PATCH v2 2/2] nbd: Coroutine based nbd_send_negotiate Fam Zheng
2016-01-11 14:00   ` Paolo Bonzini [this message]
2016-01-12 11:44     ` Fam Zheng

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=5693B59A.6040806@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.