1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-26 14:03:49 +03:00

qemu: Move qemuMigrationParamsSetCompression

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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2018-03-27 23:41:39 +02:00
parent 0809f1bac4
commit 1c35387cc2

View File

@ -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,
@ -342,35 +372,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