From nobody Mon Feb 9 01:51:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1669822282; cv=none; d=zohomail.com; s=zohoarc; b=LvMy5S3AXvNmS60ALf39JMpfHrbw6eWSahbf5V4499etkuXOHlERaHhgTm1L2vIXLziIa9BAoyT+2NN9hTAYAoXTnLXClwiA/G6PcWE19YkMgV6Vhfd63X69HgcBLXdc4JgaOD5r+OSWpimUrWUGWvT3T0iBArAAZ2VPxJmMtO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669822282; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=RLr/ixFr4HSeETgL1ZeLCsi2AacyVwCWPYwzg/pVKJ0=; b=NTMoo90LlDiUwGJHFYx3mlVupZ4mihLsmX4N8pgTi9dMFxHsI0jCSZpmw3QeFl3M0SqPdPvRhhHblvJCN24WYgECCSIRVjwC5T1+y4caT6iV8YpbpeZ3lPV+KFYWmIPzJgsv9vCnWnRNuLRCFqoJ0PtC1yU+qTnlFqjc5erWHG0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1669822282144704.4457668513852; Wed, 30 Nov 2022 07:31:22 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-gZZUtZapMTm2_ZXrZrzvDg-1; Wed, 30 Nov 2022 10:31:16 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F8EA811E67; Wed, 30 Nov 2022 15:31:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B73D42166B26; Wed, 30 Nov 2022 15:31:11 +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 91AD219465A0; Wed, 30 Nov 2022 15:31:11 +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 E48511946586 for ; Wed, 30 Nov 2022 14:24:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 580342166B3A; Wed, 30 Nov 2022 14:24:07 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34EC02166B26 for ; Wed, 30 Nov 2022 14:24:07 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 20CDC244C78; Wed, 30 Nov 2022 15:24:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669822281; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RLr/ixFr4HSeETgL1ZeLCsi2AacyVwCWPYwzg/pVKJ0=; b=DPVuR6Ago8p8MFejNIJjkQW4Z5jE8dt+8To9TQAkkXrgXs+nK+gbqrZBHOcmPGf+IcWe3k l/ckdm6Ehb0h3RkFDM7QGsZCPSyEB2ELeHCBapWv5pZfT523KSfgRvRr+T2xpAEpoy3NpV 46PVNHI+Bx+4gwvu6HVr4HL+x4Xuttc= X-MC-Unique: gZZUtZapMTm2_ZXrZrzvDg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: Pass vm to qemuMigrationCookieParse if it exists Date: Wed, 30 Nov 2022 15:24:02 +0100 Message-Id: <284d27c736d0aa0231226031154b5b9eba6d4b76.1669818242.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 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 3.1 on 10.11.54.6 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: 1669822283790100003 Content-Type: text/plain; charset="utf-8" The vm object is used inside qemuMigrationCookieParse based on the flags passed to qemuMigrationCookieParse and the content of the cookie. The callers should not just blindly guess and pass NULL if they (incorrectly) think the vm object is not needed. We should always pass the vm object unless it does not exist yet. This fixes a bug when statistics of a completed migration reported "Unknown" operation instead of "Incoming migration" on the destination host. https://bugzilla.redhat.com/show_bug.cgi?id=3D2137298 Fixes: v8.7.0-79-g0150f7a8c1 Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index bef06f4caf..6d3810c79c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4775,7 +4775,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, QEMU_MIGRATION_COOKIE_GRAPHICS | QEMU_MIGRATION_COOKIE_CAPS | QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMA= PS, - NULL); + vm); if (!mig) goto error; =20 @@ -6459,7 +6459,7 @@ qemuMigrationDstFinishOffline(virQEMUDriver *driver, g_autoptr(qemuMigrationCookie) mig =3D NULL; =20 if (!(mig =3D qemuMigrationCookieParse(driver, vm->def, priv->origname= , priv, - cookiein, cookieinlen, cookie_fla= gs, NULL))) + cookiein, cookieinlen, cookie_fla= gs, vm))) return NULL; =20 if (qemuMigrationDstPersist(driver, vm, mig, false) < 0) @@ -6655,7 +6655,7 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver, vm, flags, retcode); =20 if (!(mig =3D qemuMigrationCookieParse(driver, vm->def, priv->origname= , priv, - cookiein, cookieinlen, cookie_fla= gs, NULL))) + cookiein, cookieinlen, cookie_fla= gs, vm))) goto error; =20 if (retcode !=3D 0) { --=20 2.38.1