qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 16/21] migration: Add support for modules


From: Juan Quintela
Subject: Re: [PATCH v3 16/21] migration: Add support for modules
Date: Fri, 24 Jan 2020 19:56:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

"Dr. David Alan Gilbert" <address@hidden> wrote:
> * Juan Quintela (address@hidden) wrote:
>> So we don't have to compile everything in, or have ifdefs
>
> Can you explain to me what this is allowing us to do?

See the zstd support.
We don't need to do anything in any other file.  If you compile-in the
multifd-zstd.c code, you have it.  It is to avoid this kind of
constructs:

    if (strstart(uri, "tcp:", &p)) {
        tcp_start_outgoing_migration(s, p, &local_err);
#ifdef CONFIG_RDMA
    } else if (strstart(uri, "rdma:", &p)) {
        rdma_start_outgoing_migration(s, p, &local_err);
#endif
    } else if (strstart(uri, "exec:", &p)) {
        exec_start_outgoing_migration(s, p, &local_err);
    } else if (strstart(uri, "unix:", &p)) {
        unix_start_outgoing_migration(s, p, &local_err);
    } else if (strstart(uri, "fd:", &p)) {
        fd_start_outgoing_migration(s, p, &local_err);
    } else {
        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "uri",
                   "a valid migration protocol");
        migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
                          MIGRATION_STATUS_FAILED);
        block_cleanup_parameters(s);
        return;
    }

This is the following bit that I am going to try, put all the code of
rdma/exec/... in its own file, being able to compile it out and not
having ifdefs left and right.

(In the case of zstd, we still have some code in because I don't know
how to convince qapi of doing:

#ifdef CONFIG_ZSTD
{ 'enum': 'MultiFDMethod',
#ifdef CONFIG_ZSTD
  'data': [ 'none', 'zlib', 'zstd' ] }
#else
  'data': [ 'none', 'zlib' ] }
#endif

If I am told how to fix this, I will change

static MultiFDMethods *multifd_ops[MULTIFD_METHOD__MAX] = {
    [MULTIFD_METHOD_NONE] = &multifd_nocomp_ops,
};

And remove the last dependency.

Thanks, Juan.




reply via email to

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