
On 05.02.2016 18:34, Jiri Denemark wrote:
I still think that to enable migration in a nice backward compatible way, a user should use VIR_MIGRATE_COMPRESSED flag *and* optionally select the compression algorithm(s) via VIR_MIGRATE_PARAM_COMPRESSION parameter. If VIR_MIGRATE_PARAM_COMPRESSION is not used, the hypervisor (driver) will choose a default method.
On Thu, Jan 28, 2016 at 10:04:28 +0300, Nikolay Shirokovskiy wrote:
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- include/libvirt/libvirt-domain.h | 13 +++++- src/qemu/qemu_driver.c | 75 +++++++++++++++++++++++++++++--- src/qemu/qemu_migration.c | 94 ++++++++++++++++++++++++++++------------ src/qemu/qemu_migration.h | 16 +++++++ src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 1 + 6 files changed, 166 insertions(+), 35 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 65f1618..e868515 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -655,7 +655,7 @@ typedef enum { * when supported */ VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even if it is considered unsafe */ VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migrate */ - VIR_MIGRATE_COMPRESSED = (1 << 11), /* compress data during migration */ + VIR_MIGRATE_COMPRESSED = (1 << 11), /* use default compression method */
I'd imagine something like "compress data during migration using a method selected by the hypervisor or via VIR_MIGRATE_PARAM_COMPRESSION parameter.
ok
+static int +qemuGetCompression(virTypedParameterPtr params, int nparams, + unsigned int flags, + qemuMigrationCompressionPtr compression) +{ + size_t i; + + memset(compression, 0, sizeof(*compression));
Hmm, I think qemuMigrationCompression structure should be allocated on the heap (rather than on the stack) and the allocator would also take care of setting appropriate "unspecified" values. And please, move these migration related functions in qemu_migrate.c.
ok
Jirka