qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 2/5] migration: moving migration start code


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [RFC PATCH 2/5] migration: moving migration start code to a separated routine
Date: Tue, 05 Jun 2012 10:44:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120422 Thunderbird/10.0.4

  Hi,

> -static MigrationState *migrate_init(int blk, int inc)
> +static MigrationState *migrate_init(int protocol, const char *protocol_param,
> +                                    int blk, int inc)

> +    s->protocol = protocol;
> +    s->protocol_param = g_strdup(protocol_param);

Hmm, I think I would store the complete uri here ...

>      if (strstart(uri, "tcp:", &p)) {
> -        ret = tcp_start_outgoing_migration(s, p, errp);
> +        migrate_protocol = MIGRATION_PROTOCOL_TCP;
>  #if !defined(WIN32)
>      } else if (strstart(uri, "exec:", &p)) {
> -        ret = exec_start_outgoing_migration(s, p);
> +        migrate_protocol = MIGRATION_PROTOCOL_EXEC;
>      } else if (strstart(uri, "unix:", &p)) {
> -        ret = unix_start_outgoing_migration(s, p);
> +        migrate_protocol = MIGRATION_PROTOCOL_UNIX;
>      } else if (strstart(uri, "fd:", &p)) {
> -        ret = fd_start_outgoing_migration(s, p);
> +        migrate_protocol = MIGRATION_PROTOCOL_FD;
>  #endif

... then just move that uri parsing code block to migrate_start().

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]