qemu: Refactor qemuMigrationParams
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: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
Showing
想要评论请 注册 或 登录