From nobody Tue Sep 9 19:12:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173773117847850.19280228148443; Fri, 24 Jan 2025 07:06:18 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 36FDC155A; Fri, 24 Jan 2025 10:06:17 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id CA8671516; Fri, 24 Jan 2025 10:05:56 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 24F7814C6; Fri, 24 Jan 2025 10:05:53 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A33B2142C for ; Fri, 24 Jan 2025 10:05:52 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-nYhu0KzbM7C0exWygp-sYQ-1; Fri, 24 Jan 2025 10:05:51 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 210AA196F576 for ; Fri, 24 Jan 2025 15:05:50 +0000 (UTC) Received: from orkuz (unknown [10.45.224.7]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9AE8D19560A7 for ; Fri, 24 Jan 2025 15:05:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737731152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hua6vDauuk5i8K5G5ZMlzYSqBB/psuagycxvP+weM60=; b=ME/HT7cC1Rh/vVMpCWo21H/TxslZp9FE06LRpoFhEqO9gJQSFZv6c/9cE9D1g6E5pBGI63 n6aXFQiqrS2LB3dnb+j4E4GNI+k6YdekPOrG8zyk1e4MFwioqzTkuEKkA/GNnkl9feal6X AWecgzNwYA3uhtDeZ++CDrLNtdJ1YPc= X-MC-Unique: nYhu0KzbM7C0exWygp-sYQ-1 X-Mimecast-MFC-AGG-ID: nYhu0KzbM7C0exWygp-sYQ From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH] qemu: Allow virDomainBlockJobSetSpeed during migration Date: Fri, 24 Jan 2025 16:05:43 +0100 Message-ID: <27705fdf5a41b57bf8c3bdf6968c8d7c7de9b103.1737731143.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tZqUB82k-N9LtisaHnejeWRkAoUqmZVrkfrJDCd5joo_1737731150 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HAA2QEZPGTYG6BHURL7GUTZFGV2YQ675 X-Message-ID-Hash: HAA2QEZPGTYG6BHURL7GUTZFGV2YQ675 X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1737731181057019100 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Michal Privoznik --- 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 mig= ration. - 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 du= ring + migration. The code may only change = state + in a way that does not affect migrat= ion. + Used in event handlers which need to= be + processed even during migration or f= or + setting block job speed when migrati= ng + with non-shared storage. */ =20 /* The following two items must always be the last items before JOB_LA= ST */ 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; =20 - if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0) + if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY_MIGRATION_SAFE) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) --=20 2.48.1