mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
657980693c
commit
b51415513c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user