[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 2/2] nbd: Coroutine based nbd_send_negotiate
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH v2 2/2] nbd: Coroutine based nbd_send_negotiate |
Date: |
Mon, 11 Jan 2016 15:00:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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