[Spice-devel] [PATCH] fix spice-server segfault on migration

Uri Lublin uril at redhat.com
Tue Feb 15 03:26:29 PST 2011


On 02/15/2011 11:39 AM, Gerd Hoffmann wrote:
> spice-server tries to use the migration information without checking
> whenever this is available in the first place ...
>
> Signed-off-by: Gerd Hoffmann<kraxel at redhat.com>
> ---
>   server/reds.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index ba6f552..33a23b6 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2896,6 +2896,10 @@ static void reds_mig_switch(void)
>       SpiceMsgMainMigrationSwitchHost migrate;
>       RedsOutItem *item;
>
> +    if (s == NULL) {
> +        return;
> +    }
> +
>       red_printf("");
>       item = new_out_item(SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST);
>

Ack.

What is the scenario that makes this happen ?
  - qemu call spice_server_migrate_switch (which calls reds_mig_switch)
    when there is no migration active ? (very unlikely)
  - qemu completes the migration, ask spice-server to release resources and only 
later call spice_server_migrate_switch ? (probably not)
  - qemu notifies spice-server twice ?
  - client disconnects in the middle of migration (or no client connected at 
all) ? (I bet this is it).

Thanks,
     Uri.


More information about the Spice-devel mailing list