The API will soon be called from qemuMigrationParamsFromFlags. Let's move it to avoid the need to add a forward declaration. Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/qemu/qemu_migration_params.c | 59 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index b70229a156..dfa534bfd9 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -123,6 +123,36 @@ qemuMigrationParamsFree(qemuMigrationParamsPtr migParams) migParams->params.VAR ## _set = true; \ } while (0) + +int +qemuMigrationParamsSetCompression(virDomainObjPtr vm ATTRIBUTE_UNUSED, + qemuMigrationCompressionPtr compression, + qemuMigrationParamsPtr migParams) +{ + if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE)) + ignore_value(virBitmapSetBit(migParams->caps, + QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)); + + if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_MT)) + ignore_value(virBitmapSetBit(migParams->caps, + QEMU_MONITOR_MIGRATION_CAPS_COMPRESS)); + + migParams->params.compressLevel_set = compression->level_set; + migParams->params.compressLevel = compression->level; + + migParams->params.compressThreads_set = compression->threads_set; + migParams->params.compressThreads = compression->threads; + + migParams->params.decompressThreads_set = compression->dthreads_set; + migParams->params.decompressThreads = compression->dthreads; + + migParams->params.xbzrleCacheSize_set = compression->xbzrle_cache_set; + migParams->params.xbzrleCacheSize = compression->xbzrle_cache; + + return 0; +} + + qemuMigrationParamsPtr qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, @@ -339,35 +369,6 @@ qemuMigrationParamsDisableTLS(virDomainObjPtr vm, } -int -qemuMigrationParamsSetCompression(virDomainObjPtr vm ATTRIBUTE_UNUSED, - qemuMigrationCompressionPtr compression, - qemuMigrationParamsPtr migParams) -{ - if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE)) - ignore_value(virBitmapSetBit(migParams->caps, - QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)); - - if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_MT)) - ignore_value(virBitmapSetBit(migParams->caps, - QEMU_MONITOR_MIGRATION_CAPS_COMPRESS)); - - migParams->params.compressLevel_set = compression->level_set; - migParams->params.compressLevel = compression->level; - - migParams->params.compressThreads_set = compression->threads_set; - migParams->params.compressThreads = compression->threads; - - migParams->params.decompressThreads_set = compression->dthreads_set; - migParams->params.decompressThreads = compression->dthreads; - - migParams->params.xbzrleCacheSize_set = compression->xbzrle_cache_set; - migParams->params.xbzrleCacheSize = compression->xbzrle_cache; - - return 0; -} - - /* qemuMigrationParamsResetTLS * @driver: pointer to qemu driver * @vm: domain object -- 2.17.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list