Patchwork Fix detached migration with exec.

login
register
mail settings
Submitter Chris Lalancette
Date Aug. 5, 2009, 3:07 p.m.
Message ID <1249484855-23277-1-git-send-email-clalance@redhat.com>
Download mbox | patch
Permalink /patch/30797/
State Superseded
Headers show

Comments

Chris Lalancette - Aug. 5, 2009, 3:07 p.m.
When trying to do detached migration with exec, I found that
the monitor wouldn't always return in a timely manner.  I
tracked this down to exec_start_outgoing_migration.  It
appeared we were setting the fd to NONBLOCK'ing, but in
point of fact we weren't.

This bugfix should also go onto the stable 0.10 branch

Signed-off-by: Chris Lalancette <clalance@redhat.com>
---
 migration-exec.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
Chris Lalancette - Aug. 10, 2009, 10:23 a.m.
Chris Lalancette wrote:
> When trying to do detached migration with exec, I found that
> the monitor wouldn't always return in a timely manner.  I
> tracked this down to exec_start_outgoing_migration.  It
> appeared we were setting the fd to NONBLOCK'ing, but in
> point of fact we weren't.
> 
> This bugfix should also go onto the stable 0.10 branch

ping?

> 
> Signed-off-by: Chris Lalancette <clalance@redhat.com>
> ---
>  migration-exec.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/migration-exec.c b/migration-exec.c
> index e3616be..ef4620f 100644
> --- a/migration-exec.c
> +++ b/migration-exec.c
> @@ -73,10 +73,7 @@ MigrationState *exec_start_outgoing_migration(const char *command,
>          goto err_after_open;
>      }
>  
> -    if (fcntl(s->fd, F_SETFD, O_NONBLOCK) == -1) {
> -        dprintf("Unable to set nonblocking mode on file descriptor\n");
> -        goto err_after_open;
> -    }
> +    socket_set_nonblock(s->fd);
>  
>      s->opaque = qemu_popen(f, "w");
>

Patch

diff --git a/migration-exec.c b/migration-exec.c
index e3616be..ef4620f 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -73,10 +73,7 @@  MigrationState *exec_start_outgoing_migration(const char *command,
         goto err_after_open;
     }
 
-    if (fcntl(s->fd, F_SETFD, O_NONBLOCK) == -1) {
-        dprintf("Unable to set nonblocking mode on file descriptor\n");
-        goto err_after_open;
-    }
+    socket_set_nonblock(s->fd);
 
     s->opaque = qemu_popen(f, "w");