All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Subject: Re: [Qemu-trivial] [PATCH] qemu-nbd: drop loop which can never loop
Date: Thu, 05 Jan 2012 14:29:01 +0100	[thread overview]
Message-ID: <4F05A59D.4060407@redhat.com> (raw)
In-Reply-To: <1325769367-32267-1-git-send-email-stefanha@linux.vnet.ibm.com>

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<davidagilbert@uk.ibm.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);

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-nbd: drop loop which can never loop
Date: Thu, 05 Jan 2012 14:29:01 +0100	[thread overview]
Message-ID: <4F05A59D.4060407@redhat.com> (raw)
In-Reply-To: <1325769367-32267-1-git-send-email-stefanha@linux.vnet.ibm.com>

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<davidagilbert@uk.ibm.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);

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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	other threads:[~2012-01-05 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 13:16 [Qemu-trivial] [PATCH] qemu-nbd: drop loop which can never loop Stefan Hajnoczi
2012-01-05 13:16 ` [Qemu-devel] " Stefan Hajnoczi
2012-01-05 13:29 ` Paolo Bonzini [this message]
2012-01-05 13:29   ` Paolo Bonzini
2012-01-05 14:22   ` [Qemu-trivial] " Stefan Hajnoczi
2012-01-05 14:22     ` Stefan Hajnoczi
2012-01-06 15:10 ` [Qemu-trivial] " Stefan Hajnoczi
2012-01-06 15:10   ` [Qemu-devel] " Stefan Hajnoczi

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=4F05A59D.4060407@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=davidagilbert@uk.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.