From nobody Wed May 8 05:31:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551870959266203.36088172383154; Wed, 6 Mar 2019 03:15:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0253C2D7E7; Wed, 6 Mar 2019 11:15:57 +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 1919260DB4; Wed, 6 Mar 2019 11:15:56 +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 68D3241F3D; Wed, 6 Mar 2019 11:15:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26BFCMI030663 for ; Wed, 6 Mar 2019 06:15:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id E79205D732; Wed, 6 Mar 2019 11:15:12 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA36C5D6A9 for ; Wed, 6 Mar 2019 11:15:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 28A281011B8; Wed, 6 Mar 2019 12:15:09 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 6 Mar 2019 12:15:08 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Don't set migration caps when changing postcopy bandwidth 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 06 Mar 2019 11:15:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The qemuMigrationParamsApply internal API was designed to apply all migration parameters and capabilities before we start to migrate a domain. The API can also be called outside migration job, e.g., via a call to qemuDomainMigrateSetMaxSpeed with VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY flag, but in that case it should only apply migration parameters and ignore capabilities. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Best viewed with --ignore-all-space src/qemu/qemu_migration_params.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 24e5368783..623193cf6c 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -778,14 +778,23 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; =20 - if (!(caps =3D qemuMigrationCapsToJSON(priv->migrationCaps, migParams-= >caps))) - goto cleanup; - - if (virJSONValueArraySize(caps) > 0) { - rc =3D qemuMonitorSetMigrationCapabilities(priv->mon, caps); - caps =3D NULL; - if (rc < 0) + if (asyncJob =3D=3D QEMU_ASYNC_JOB_NONE) { + if (!virBitmapIsAllClear(migParams->caps)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Migration capabilities can only be set by " + "a migration job")); goto cleanup; + } + } else { + if (!(caps =3D qemuMigrationCapsToJSON(priv->migrationCaps, migPar= ams->caps))) + goto cleanup; + + if (virJSONValueArraySize(caps) > 0) { + rc =3D qemuMonitorSetMigrationCapabilities(priv->mon, caps); + caps =3D NULL; + if (rc < 0) + goto cleanup; + } } =20 /* If QEMU is too old to support xbzrle-cache-size migration parameter, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list