On Wed, Apr 11, 2018 at 04:41:46PM +0200, Jiri Denemark wrote:
Adding support for new migration parameter requires a lot of places
to
be changed (most likely by copy&paste engineering): new variables to
store the parameter value and the associated *_set bool, JSON formatter
and parser, XML formatter and parser (to be added soon), and the actual
code to set the parameter. It's pretty easy to forget about some of the
places which need to be updated and end up with incorrect support. The
goal of this patch is to let most of the places do their job without any
modifications when new parameters are added.
To achieve the goal, a new qemuMigrationParam enum is introduced and all
parameters are stored in an array indexed by the items of this enum.
This will also allow us to automatically set the migration parameters
which directly correspond to libvirt's typed parameters accepted by
virDomainMigrate* APIs.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_migration_params.c | 470 ++++++++++++++++++++-----------
src/qemu/qemu_migration_params.h | 20 ++
2 files changed, 328 insertions(+), 162 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano