From nobody Sun Feb 8 12:20:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1658502600; cv=none; d=zohomail.com; s=zohoarc; b=joS4sBkz9gjMUTiqnanV1UPKFANIYNI9ZrMy3lAu5doa+xwk0ZdXuQDv9CyVGINBoWvleyNCgXIzhIY7Oaj+epyI/ZTlUaFBcyz5GPgqE9KwmHTqkvIuyTKBp7TENimQAGEWbenwuRzrNyuSkvB+ZLAwNeiz5PuVgF3dWoP9NX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658502600; 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=aqN0g3BAIfIlLnxpedu2uu2CVHLw4zoZZ++9L8GdJBY=; b=PdaPN68o7L1YMmEIbV8WZJikRsQngNNf0NaMXwz809ZiTctzEXNZkT6fNd6G9CObl9/DuPiAJ2Aa/ELxZGmNG5CiIFet6csxEOc5IqjmNWuW3bQlC1PfAa8thlEdjUTWlMH7wsMLXEarTxW3tik3YF9l0cHQwkFnwRyh0tKDXK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658502600347457.79855374185354; Fri, 22 Jul 2022 08:10:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-376-Hac7U1bvPF-0BC0gzX6CMg-1; Fri, 22 Jul 2022 11:09:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E109B1C0691C; Fri, 22 Jul 2022 15:09:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DC7C404754B; Fri, 22 Jul 2022 15:09:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4542D194704D; Fri, 22 Jul 2022 15:09:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CD484194704D for ; Fri, 22 Jul 2022 15:09:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BD4B52166B2B; Fri, 22 Jul 2022 15:09:51 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E1362166B26 for ; Fri, 22 Jul 2022 15:09:51 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 78C8018B30D; Fri, 22 Jul 2022 17:09:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658502599; 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=aqN0g3BAIfIlLnxpedu2uu2CVHLw4zoZZ++9L8GdJBY=; b=LiflIBmOCFBELDvOPTdGWcoaBqroq0iOctDQT1Bro1k5ejFqJUVHUpf37ZzlJs6xJ039+e PCOh6JkfmW92rx6H4TzMGEB5eauqGbXZu1qCZa+hhpP1YftIFqYM/xNOG0a2sF+xMTstnL bklVOoymjwIWrGaLxVOSRMAOBCpcdCY= X-MC-Unique: Hac7U1bvPF-0BC0gzX6CMg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu_migration_params: Refactor qemuMigrationParamsReset Date: Fri, 22 Jul 2022 17:09:00 +0200 Message-Id: <48011c976a31d514f5bebfbe3f2fa7f6c736afef.1658502471.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: 1658502603446100003 Content-Type: text/plain; charset="utf-8" Because qemuMigrationParamsReset used to call qemuMigrationParamsApply for resetting migration capabilities and parameters, it did not work well since commit v5.1.0-83-ga1dec315c9 which only allowed capabilities to be set from an async job. However, when reconnecting to running domains after daemon restart we do not have an async job. Thus the capabilities were not properly reset in case the daemon was restarted during an ongoing migration. We need to avoid calling qemuMigrationParamsApply to make sure both parameters and capabilities can be reset by a normal job. https://bugzilla.redhat.com/show_bug.cgi?id=3D2107892 Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index dcfb30b56f..be7966a18a 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -1290,6 +1290,7 @@ qemuMigrationParamsReset(virQEMUDriver *driver, unsigned long apiFlags) { virErrorPtr err; + g_autoptr(virBitmap) clearCaps =3D NULL; =20 virErrorPreserveLast(&err); =20 @@ -1299,13 +1300,16 @@ qemuMigrationParamsReset(virQEMUDriver *driver, if (!virDomainObjIsActive(vm) || !origParams) goto cleanup; =20 - /* Do not pass apiFlags to qemuMigrationParamsApply here to make sure = all - * parameters and capabilities are reset. */ - if (qemuMigrationParamsApply(driver, vm, asyncJob, origParams, 0) < 0) + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto cleanup; =20 - qemuMigrationParamsResetTLS(driver, vm, asyncJob, origParams, apiFlags= ); - /* We don't reset 'block-bitmap-mapping' as it can't be unset */ + clearCaps =3D virBitmapNew(0); + + if (qemuMigrationParamsApplyCaps(vm, clearCaps) =3D=3D 0 && + qemuMigrationParamsApplyValues(vm, origParams, false) =3D=3D 0) + qemuMigrationParamsResetTLS(driver, vm, asyncJob, origParams, apiF= lags); + + qemuDomainObjExitMonitor(vm); =20 cleanup: virErrorRestore(&err); --=20 2.35.1