Patchwork fix segfault on fd-migration starting

login
register
mail settings
Submitter Wen Congyang
Date Nov. 7, 2011, 2:34 a.m.
Message ID <4EB743CB.10403@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/123991/
State New
Headers show

Comments

Wen Congyang - Nov. 7, 2011, 2:34 a.m.
We set s->mon to NULL in migrate_init. But we will use it
to search fd when do fd-migration, and it will cause qemu
crashed.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>

---
 migration.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Juan Quintela - Nov. 7, 2011, 11:22 a.m.
Wen Congyang <wency@cn.fujitsu.com> wrote:
> We set s->mon to NULL in migrate_init. But we will use it
> to search fd when do fd-migration, and it will cause qemu
> crashed.
>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>
> ---
>  migration.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 4b17566..d094381 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -383,7 +383,7 @@ static MigrationState *migrate_init(Monitor *mon, int detach, int blk, int inc)
>      s->bandwidth_limit = bandwidth_limit;
>      s->blk = blk;
>      s->shared = inc;
> -    s->mon = NULL;
> +    s->mon = mon;
>      s->bandwidth_limit = bandwidth_limit;
>      s->state = MIG_STATE_SETUP;


Problem is real.
Patch is wrong, because now we "resume" the monitor even when we are
doing detached migration.  Looking into it.

Thanks, Juan.

Patch

diff --git a/migration.c b/migration.c
index 4b17566..d094381 100644
--- a/migration.c
+++ b/migration.c
@@ -383,7 +383,7 @@  static MigrationState *migrate_init(Monitor *mon, int detach, int blk, int inc)
     s->bandwidth_limit = bandwidth_limit;
     s->blk = blk;
     s->shared = inc;
-    s->mon = NULL;
+    s->mon = mon;
     s->bandwidth_limit = bandwidth_limit;
     s->state = MIG_STATE_SETUP;