[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.
- [PATCH v3 12/21] multifd: multifd_queue_page only needs the qemufile, (continued)
- [PATCH v3 12/21] multifd: multifd_queue_page only needs the qemufile, Juan Quintela, 2020/01/23
- [PATCH v3 13/21] multifd: multifd_send_sync_main only needs the qemufile, Juan Quintela, 2020/01/23
- [PATCH v3 14/21] multifd: Use qemu_target_page_size(), Juan Quintela, 2020/01/23
- [PATCH v3 15/21] migration: Make checkpatch happy with comments, Juan Quintela, 2020/01/23
- [PATCH v3 16/21] migration: Add support for modules, Juan Quintela, 2020/01/23
- [PATCH v3 18/21] migration: Make no compression operations into its own structure, Juan Quintela, 2020/01/23
- [PATCH v3 20/21] configure: Enable test and libs for zstd, Juan Quintela, 2020/01/23
- [PATCH v3 19/21] migration: Add zlib compression multifd support, Juan Quintela, 2020/01/23