diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-01-05 13:16:07 +0000 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-01-06 15:09:53 +0000 |
commit | dc10e8b3c556b582eb7919c92d0997b5f9a9d136 (patch) | |
tree | 766d079387e2f0cc176b7be89c278bd067023396 /qemu-nbd.c | |
parent | 7a3fc891ae3256e4fbf03b6ab6d3ced0dfaaaa27 (diff) | |
download | qemu-dc10e8b3c556b582eb7919c92d0997b5f9a9d136.tar.gz qemu-dc10e8b3c556b582eb7919c92d0997b5f9a9d136.tar.bz2 qemu-dc10e8b3c556b582eb7919c92d0997b5f9a9d136.zip |
qemu-nbd: drop loop which can never loop
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 <davidagilbert@uk.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r-- | qemu-nbd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c index 155b05840b..eb61c33acd 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); |