qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] qemu-nbd: drop loop which can never loop


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCH] qemu-nbd: drop loop which can never loop
Date: Thu, 05 Jan 2012 14:29:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 01/05/2012 02:16 PM, Stefan Hajnoczi wrote:
For some reason nbd_client_thread() has a do..while loop which can never
loop, the condition is bogus because we would take a goto instead.  Drop
the loop.

Reported-by: Dr David Alan Gilbert<address@hidden>
Signed-off-by: Stefan Hajnoczi<address@hidden>
---
  qemu-nbd.c |   10 ++++------
  1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 155b058..eb61c33 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -202,12 +202,10 @@ static void *nbd_client_thread(void *arg)
      int ret;
      pthread_t show_parts_thread;

-    do {
-        sock = unix_socket_outgoing(sockpath);
-        if (sock == -1) {
-            goto out;
-        }
-    } while (sock == -1);
+    sock = unix_socket_outgoing(sockpath);
+    if (sock == -1) {
+        goto out;
+    }

      ret = nbd_receive_negotiate(sock, NULL,&nbdflags,
                                  &size,&blocksize);

Reviewed-by: Paolo Bonzini <address@hidden>

It used to loop until commit f1ef555. When I simplified the loop I failed to actually remove it.

I suppose it will get in through your trivial patches tree, won't it?

Paolo



reply via email to

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