When a migration with non-shared storage is started with VIR_MIGRATE_PARAM_BANDWIDTH set, it will be applied to both memory migration and each block job started for storage migration. Once the migration is running virDomainMigrateSetMaxSpeed may be used to change the bandwidth used by memory migration, but there was no way of changing storage migration speed. Let's allow virDomainBlockJobSetSpeed during migration to enable the missing functionality. Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/conf/virdomainjob.h | 11 +++++++---- src/qemu/qemu_driver.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/conf/virdomainjob.h b/src/conf/virdomainjob.h index 8b2dccd298..d8685cf236 100644 --- a/src/conf/virdomainjob.h +++ b/src/conf/virdomainjob.h @@ -37,10 +37,13 @@ typedef enum { VIR_JOB_MODIFY, /* May change state */ VIR_JOB_ABORT, /* Abort current async job */ VIR_JOB_MIGRATION_OP, /* Operation influencing outgoing migration */ - VIR_JOB_MODIFY_MIGRATION_SAFE, /* Internal only job for event handlers which - need to be processed even during migration. - The code may only change state in a way - that does not affect migration. */ + VIR_JOB_MODIFY_MIGRATION_SAFE, /* Modify job that is safe to be run during + migration. The code may only change state + in a way that does not affect migration. + Used in event handlers which need to be + processed even during migration or for + setting block job speed when migrating + with non-shared storage. */ /* The following two items must always be the last items before JOB_LAST */ VIR_JOB_ASYNC, /* Asynchronous job */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d2eddbd9ae..a1fc61bae2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13982,7 +13982,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, if (virDomainBlockJobSetSpeedEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0) + if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY_MIGRATION_SAFE) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) -- 2.48.1