From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 9/9] qemu-nbd: drop loop which can never loop
Date: Fri, 6 Jan 2012 15:51:28 +0000 [thread overview]
Message-ID: <1325865088-23897-10-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1325865088-23897-1-git-send-email-stefanha@linux.vnet.ibm.com>
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>
---
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);
--
1.7.7.3
next prev parent reply other threads:[~2012-01-06 15:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 15:51 [Qemu-devel] [PULL 0/9] Trivial patches for 20 December 2011 to 6 January 2012 Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 1/9] qemu-options.hx: fix tls-channel help text Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 2/9] Strip trailing '\n' from error_report()'s first argument (again) Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 3/9] scsi virtio-blk usb-msd: Clean up device init error messages Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 4/9] configure: CONFIG_QEMU_INTERP_PREFIX only for user mode Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 5/9] configure: Fix test for supported host CPU type Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 6/9] gdbstub: Fix fd leak in gdbserver_open() error path Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 7/9] net/socket.c: Fix fd leak in net_socket_listen_init() error paths Stefan Hajnoczi
2012-01-06 15:51 ` [Qemu-devel] [PATCH 8/9] Make python mandatory Stefan Hajnoczi
2012-01-06 15:51 ` Stefan Hajnoczi [this message]
2012-01-09 14:51 ` [Qemu-devel] [PULL 0/9] Trivial patches for 20 December 2011 to 6 January 2012 Anthony Liguori
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=1325865088-23897-10-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).