qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()
Date: Fri, 20 Jun 2014 19:04:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 19.06.2014 05:58, Stefan Hajnoczi wrote:
On Wed, Jun 18, 2014 at 09:06:41PM +0200, Max Reitz wrote:
+static void nbd_update_can_read(NBDClient *client)
+{
+    bool can_read = client->recv_coroutine ||
+                    client->nb_requests < MAX_NBD_REQUESTS;
+
+    if (can_read != client->can_read) {
+        client->can_read = can_read;
+        nbd_set_handlers(client);
+
+        /* If we got here, nb_requests had to be MAX_NBD_REQUESTS before */
+        if (client->nb_requests < MAX_NBD_REQUESTS) {
+            aio_notify(client->exp->ctx);
+        }
nbd_set_handlers() indirectly invokes aio_notify(client->exp->ctx) via
aio_set_fd_handler().  This if statement is redundant.

Thanks for spotting this, I'll drop it in v3.

Max



reply via email to

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