From nobody Mon May 13 18:05:11 2024 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=1653317192; cv=none; d=zohomail.com; s=zohoarc; b=N6B8Xq8vRmOLiXHGdSvZBXYPIw0s2FoNDzhxtncg3WMZI06Rc2udbUibckgWctGWWt0W3TQ1rfvRqLUnG2BlCtmqlvPZ7oFm8prs1eUOYWBWc05RaBfVpafgmywSfATbCLy4ahMkKe5p3dR0p46zWiYTzRIu8IA2YvCjgWh4KaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653317192; 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=lY9SuOQxorTIGxLchLpqdA74O8n6GZi8knPCkGiAQTY=; b=K6i9dQKT1Vr7nQwZQd2Fu/UPa4phtoeMlLOTDw6UCDLIasJqkwMo5l8I4dFocWhFxqmP4ykCSrhgh+DqVm6tjl2XYBZw/0QfJ6r1kgHh+ehFgsDWFr7uRETo1lZjAW1apP174P90fal4CYsDwJypj0PzIqW7xHjFIAiHfIrh8+0= 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 1653317192245197.04426404795709; Mon, 23 May 2022 07:46:32 -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-212-wSdqmhp1MSaYp9kqbnXRiQ-1; Mon, 23 May 2022 10:46:29 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0811238349B3; Mon, 23 May 2022 14:46:27 +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 3C071492CA3; Mon, 23 May 2022 14:46:26 +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 EBA57194705B; Mon, 23 May 2022 14:46:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C470A1947059 for ; Mon, 23 May 2022 14:46:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B2F85C27E98; Mon, 23 May 2022 14:46:24 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92E23C1914E for ; Mon, 23 May 2022 14:46:24 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8B44F245AE7; Mon, 23 May 2022 16:46:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653317191; 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=lY9SuOQxorTIGxLchLpqdA74O8n6GZi8knPCkGiAQTY=; b=VBoGTVzSs/RQTP7DinMhC9/kysy1Si4dZciX0lXouKYgSNpzcTY0Rsm0pcBIOa7CWZm1GR CG15OaZ4dxiB6UwQErcSEtVYaAth2YQfrizdvZL62AMbzkjicTQdS83eNZGIljSWisgqzC YR0rxcBzJuE9Zf4ScejAHv4oN3MZse0= X-MC-Unique: wSdqmhp1MSaYp9kqbnXRiQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: Do not return NULL when qemuMigrationSrcBegin succeeds Date: Mon, 23 May 2022 16:46:21 +0200 Message-Id: <3dffdae10568cc288051f68b547aa19b8bc081b6.1653317181.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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.85 on 10.11.54.9 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: 1653317194342100001 Content-Type: text/plain; charset="utf-8" My recent commit v8.3.0-201-gc500955e95 tried to fix a regression which would cause the function to return success even if virCloseCallbacksSet failed. But due to a strange code flow in the function introduced an opposite regression. The function would return NULL on success when called without VIR_MIGRATE_CHANGE_PROTECTION flag. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 38596fa4de..6cc68a567a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2534,23 +2534,23 @@ qemuMigrationSrcBegin(virConnectPtr conn, if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, qemuMigrationSrcCleanup) < 0) goto endjob; - qemuMigrationJobContinue(vm); - } else { - goto endjob; } =20 ret =3D g_steal_pointer(&xml); =20 + endjob: + if (flags & VIR_MIGRATE_CHANGE_PROTECTION) { + if (ret) + qemuMigrationJobContinue(vm); + else + qemuMigrationJobFinish(vm); + } else { + qemuDomainObjEndJob(vm); + } + cleanup: virDomainObjEndAPI(&vm); return ret; - - endjob: - if (flags & VIR_MIGRATE_CHANGE_PROTECTION) - qemuMigrationJobFinish(vm); - else - qemuDomainObjEndJob(vm); - goto cleanup; } =20 =20 --=20 2.35.1