From nobody Fri Mar 29 06:02:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633681170; cv=none; d=zohomail.com; s=zohoarc; b=BSsgH1PQkw5whSmAAn5BejA64JkSCvgV7kvOK8YzKj2fsu7m1GhGXuFGqBU9AIeqoabwck+t1UmO49E7go28sp4GprcKcSvT+WX5T+I6q2hNQeN1vp8AsVE9HYl6LQ858TUdoyzQ1nSj7U+ais9/RT2bMun0Ovh/q/cK6MVcpvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633681170; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rPASWpFVlQWLrDQq0120qkXiNJOGQ2DRJ6E23VMVDpY=; b=I3UEmp6HHCXNGamym9wk2gO//JEMy6+3PyUPBBU1xHy/oO/0EZCPxe5HABWnEUVMhkABUHGkA+FlLOE1zSWLP/WJxZ4zh1Qdxp1wkpz/vWyeDFeePFIMYuWv6PovnUuBK3QdV0T6VOorfWqu2HVJXPWGIuEtd9G8dwoqrSua7fk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1633681170914816.0944721224731; Fri, 8 Oct 2021 01:19:30 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-MEVSxyXhOD2PRtlDXjNMyA-1; Fri, 08 Oct 2021 04:19:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60D4C8010E9; Fri, 8 Oct 2021 08:19:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AE9760C0F; Fri, 8 Oct 2021 08:19:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CFF7C1806D01; Fri, 8 Oct 2021 08:19:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1988JMAb030152 for ; Fri, 8 Oct 2021 04:19:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E97B100238C; Fri, 8 Oct 2021 08:19:22 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E04110016F5 for ; Fri, 8 Oct 2021 08:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633681169; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rPASWpFVlQWLrDQq0120qkXiNJOGQ2DRJ6E23VMVDpY=; b=ejbXS0iputsKKimsBdMsOIgBO5G6jDaVXCiRxoA9f2PpCjA5dKQizqClj+5t9OPn8vuSl6 b1zcg9/g/sQecZaZeWRCCuiiK2qnd3Zr0H10bWLAM8dUP8aaVUGq/yR5g/uGVdHctw2MPB SgO7U34BvEpN/uPUq5tn3c5z+pNfFek= X-MC-Unique: MEVSxyXhOD2PRtlDXjNMyA-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu_migration: set bandwidth in priv during migration Date: Fri, 8 Oct 2021 10:19:04 +0200 Message-Id: <2c6a75b97f5b7131b6ad6e079161b10480594bab.1633680885.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633681171666100004 Content-Type: text/plain; charset="utf-8" We did not set priv->migMaxBandwidth if '--bandwidth' was specified as an option in the 'migrate' virsh command. This caused in printing the wrong value if virsh command 'migrate-getspeed' was called during the migration. This patch first sets the value to the given bandwidth (if one was specified) and restores the previous value after the migration. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1806856 Signed-off-by: Kristina Hanicova --- src/qemu/qemu_migration.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index dd226ea4bc..71edcd5c62 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4013,6 +4013,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, qemuMigrationIOThread *iothread =3D NULL; VIR_AUTOCLOSE fd =3D -1; unsigned long migrate_speed =3D resource ? resource : priv->migMaxBand= width; + unsigned long restore_max_bandwidth =3D priv->migMaxBandwidth; virErrorPtr orig_err =3D NULL; unsigned int cookieFlags =3D 0; bool abort_on_error =3D !!(flags & VIR_MIGRATE_ABORT_ON_ERROR); @@ -4025,6 +4026,8 @@ qemuMigrationSrcRun(virQEMUDriver *driver, g_autofree char *timestamp =3D NULL; int rc; =20 + priv->migMaxBandwidth =3D migrate_speed; + VIR_DEBUG("driver=3D%p, vm=3D%p, cookiein=3D%s, cookieinlen=3D%d, " "cookieout=3D%p, cookieoutlen=3D%p, flags=3D0x%lx, resource= =3D%lu, " "spec=3D%p (dest=3D%d, fwd=3D%d), dconn=3D%p, graphicsuri=3D= %s, " @@ -4351,6 +4354,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, if (events) priv->signalIOError =3D false; =20 + priv->migMaxBandwidth =3D restore_max_bandwidth; virErrorRestore(&orig_err); =20 return ret; --=20 2.31.1 From nobody Fri Mar 29 06:02:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633681172; cv=none; d=zohomail.com; s=zohoarc; b=Tp2fsnLv7MyirUufiA7bn9SrP+2w4fHgGB3oEBIwDAZZBMqLfiRz/DMUmV3mDAy3A3YFQ7EtqFSGFUM8CODJiPKONv2+CSzztn0tBFpVVtfUx2NNZ5PSYUOhVvayLfcjoqumm5pF1FpSNw8qb2lxY5NNI9BHUEfWUT1GAXVfGUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633681172; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g6jpbJQ+n8tXKA/a4a5uUoFaP/HxwdATn6wn5WiVNT0=; b=haktEy/GGaLqd7DJFloId/O4gdwIJ/GF6pNpdFyeXC2XSMZHm42P/lAxqmNlAX5GlkVR0Sb2AVNKii8f43eBB8nh/HCELQFVoytKh7xDRbCFDQTC056syXtsigaumapUAAPxUlWY+f2QqDCx5J0XZVlsmqXfW1wC+ziOUrUZA64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1633681172634895.8580358930319; Fri, 8 Oct 2021 01:19:32 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-Y4DbmZVWNwCktp_2jtIXKg-1; Fri, 08 Oct 2021 04:19:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20B6C835DEB; Fri, 8 Oct 2021 08:19:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0432C5F4EA; Fri, 8 Oct 2021 08:19:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B835D4E58E; Fri, 8 Oct 2021 08:19:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1988JM9R030157 for ; Fri, 8 Oct 2021 04:19:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id E157C10016FF; Fri, 8 Oct 2021 08:19:22 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C09710016F5 for ; Fri, 8 Oct 2021 08:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633681171; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g6jpbJQ+n8tXKA/a4a5uUoFaP/HxwdATn6wn5WiVNT0=; b=UrFibkQoEPGwlffZi6Cjw5n4b+Tkp4R5TNsFTa7Mw2UWz7QJkjIJ9OYW9vOQCsR6XG9YJj VRXszAwt85g0jqc6Qf1NQAWEisgTQTbnsA3amz6sUqPjDk1sDxcaxRWKU+N9Zujoy8abUH WWG7wmrCO1AkerwPe0JSUtcgBZbsgQs= X-MC-Unique: Y4DbmZVWNwCktp_2jtIXKg-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 2/2] qemu_migration: drop unnecessary 'migrate_speed' variable Date: Fri, 8 Oct 2021 10:19:05 +0200 Message-Id: <8ec9b82b0603e161e1e2166330d0d92545f521d8.1633680885.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633681173725100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kristina Hanicova Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 71edcd5c62..48df080c15 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4012,7 +4012,6 @@ qemuMigrationSrcRun(virQEMUDriver *driver, g_autofree char *tlsAlias =3D NULL; qemuMigrationIOThread *iothread =3D NULL; VIR_AUTOCLOSE fd =3D -1; - unsigned long migrate_speed =3D resource ? resource : priv->migMaxBand= width; unsigned long restore_max_bandwidth =3D priv->migMaxBandwidth; virErrorPtr orig_err =3D NULL; unsigned int cookieFlags =3D 0; @@ -4026,7 +4025,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, g_autofree char *timestamp =3D NULL; int rc; =20 - priv->migMaxBandwidth =3D migrate_speed; + priv->migMaxBandwidth =3D resource ? resource : priv->migMaxBandwidth; =20 VIR_DEBUG("driver=3D%p, vm=3D%p, cookiein=3D%s, cookieinlen=3D%d, " "cookieout=3D%p, cookieoutlen=3D%p, flags=3D0x%lx, resource= =3D%lu, " @@ -4119,7 +4118,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, =20 if (bwParam && qemuMigrationParamsSetULL(migParams, QEMU_MIGRATION_PARAM_MAX_BAND= WIDTH, - migrate_speed * 1024 * 1024) < 0) + priv->migMaxBandwidth * 1024 * 1024) < 0) goto error; =20 if (qemuMigrationParamsApply(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, @@ -4149,7 +4148,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, =20 if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig, host, - migrate_speed, + priv->migMaxBandwidth, nmigrate_disks, migrate_disks, dconn, tlsAlias, @@ -4197,7 +4196,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, } =20 if (!bwParam && - qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) + qemuMonitorSetMigrationSpeed(priv->mon, priv->migMaxBandwidth) < 0) goto exit_monitor; =20 /* connect to the destination qemu if needed */ --=20 2.31.1