]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Allow virDomainBlockJobSetSpeed during migration
authorJiri Denemark <jdenemar@redhat.com>
Fri, 24 Jan 2025 12:26:39 +0000 (13:26 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 27 Jan 2025 15:32:57 +0000 (16:32 +0100)
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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/virdomainjob.h
src/qemu/qemu_driver.c

index 8b2dccd298c8a63d9b6a6cc6c73c39470bfdaf44..d8685cf23653c3ae69109654adf7ffd474b8322d 100644 (file)
@@ -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 */
index d2eddbd9aebd42150a6c2bab702560d48a755254..a1fc61bae2a65feb75374d90311808ce8d2bd6a7 100644 (file)
@@ -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)