提交 b5141551 编写于 作者: J Jiri Denemark

qemu: Introduce qemuMigrationParty enum

Some migration parameters and capabilities are supposed to be set on
both sides of migration while others should only be set on one side. For
example, CPU throttling parameters make no sense on the destination and
they can be used even if the destination is too old to support them.

To make qemuMigrationParamsFromFlags more general and usable on both
sides of migration, we need to tell it what side it's been called on.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 65798069
......@@ -12743,7 +12743,8 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
if (nmigrate_disks < 0)
goto cleanup;
if (!(migParams = qemuMigrationParamsFromFlags(params, nparams, flags)))
if (!(migParams = qemuMigrationParamsFromFlags(params, nparams, flags,
QEMU_MIGRATION_SOURCE)))
goto cleanup;
if (!(compression = qemuMigrationAnyCompressionParse(params, nparams, flags)))
......
......@@ -80,7 +80,8 @@ qemuMigrationParamsFree(qemuMigrationParamsPtr migParams)
qemuMigrationParamsPtr
qemuMigrationParamsFromFlags(virTypedParameterPtr params,
int nparams,
unsigned long flags)
unsigned long flags,
qemuMigrationParty party)
{
qemuMigrationParamsPtr migParams;
......@@ -102,8 +103,10 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
migParams->params.VAR ## _set = true; \
} while (0)
GET(AUTO_CONVERGE_INITIAL, cpuThrottleInitial);
GET(AUTO_CONVERGE_INCREMENT, cpuThrottleIncrement);
if (party == QEMU_MIGRATION_SOURCE) {
GET(AUTO_CONVERGE_INITIAL, cpuThrottleInitial);
GET(AUTO_CONVERGE_INCREMENT, cpuThrottleIncrement);
}
#undef GET
......
......@@ -50,6 +50,11 @@ struct _qemuMigrationCompression {
typedef struct _qemuMigrationParams qemuMigrationParams;
typedef qemuMigrationParams *qemuMigrationParamsPtr;
typedef enum {
QEMU_MIGRATION_SOURCE = (1 << 0),
QEMU_MIGRATION_DESTINATION = (1 << 1),
} qemuMigrationParty;
qemuMigrationParamsPtr
qemuMigrationParamsNew(void);
......@@ -57,7 +62,8 @@ qemuMigrationParamsNew(void);
qemuMigrationParamsPtr
qemuMigrationParamsFromFlags(virTypedParameterPtr params,
int nparams,
unsigned long flags);
unsigned long flags,
qemuMigrationParty party);
void
qemuMigrationParamsFree(qemuMigrationParamsPtr migParams);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册