From nobody Mon Feb 9 06:28:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1594634425; cv=none; d=zohomail.com; s=zohoarc; b=MjZ4nC2nf4221BmRLNWGCv3VTZ8L9/rcvLk2XrMoKKBDT0D+RA4SFWKCVSw0ke+iMyWeGgHp3LbS/AdDo00xOwdz0DT8Op8Tu7dZChItM7O7DMblcR+E6oz853yy52KJ2ieFy77WfU/dP9wQ0QU1w/syuzrbtP+LWyIUx5ELcM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594634425; h=Content-Type:Content-Transfer-Encoding:Cc: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=xhTGTQwV23mEAZUFkpWOIGgnHdQd3KAcUGgaEZEuWIA=; b=X8wRzKvzcalXI/bITMkegzE5LS0kbqhuZ3IT7TtnOiGkB1XzCTxzuQoN9Eo2SidI7lwDmNEh3+d/zx07uKyqeG6aK4BTXH5cO2GbHC5S4TUk3uh+mcDaMRXMgq7mwGP5XRPGjquEnfgFZerB73lAFw3ti5MQyrGdqy4k9+UhpMo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594634425605705.6963542003425; Mon, 13 Jul 2020 03:00:25 -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-154-8LtSz6q9Mg6igbau8vW5XQ-1; Mon, 13 Jul 2020 06:00:22 -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 8A19D1902EA4; Mon, 13 Jul 2020 10:00:16 +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 3CA2560C84; Mon, 13 Jul 2020 10:00:16 +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 D243F1809554; Mon, 13 Jul 2020 10:00:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06DA0DSH007295 for ; Mon, 13 Jul 2020 06:00:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 12CC1E5964; Mon, 13 Jul 2020 10:00:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE045E2A76 for ; Mon, 13 Jul 2020 10:00:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 330C3100E7EA for ; Mon, 13 Jul 2020 09:50:45 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123-itWGZ5fyOgCmgaocB_p5Hg-1; Mon, 13 Jul 2020 05:50:43 -0400 Received: by mail-qt1-f195.google.com with SMTP id b25so9463221qto.2 for ; Mon, 13 Jul 2020 02:50:43 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:530c:1b8b:2d79:f76d:3f06]) by smtp.gmail.com with ESMTPSA id o15sm18335057qko.67.2020.07.13.02.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 02:50:42 -0700 (PDT) X-MC-Unique: 8LtSz6q9Mg6igbau8vW5XQ-1 X-MC-Unique: itWGZ5fyOgCmgaocB_p5Hg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xhTGTQwV23mEAZUFkpWOIGgnHdQd3KAcUGgaEZEuWIA=; b=sJYVSX1jWmlMJfHaqRO5tze/ZJpvCJXjCUM276eaV2Ss4CPb+qJTGrGrsrNIxLgixI 8TDm04GB1Ek6Mi6LQbh7BH+4mDkY74rxcO+SNn9E2tSguXSxAqZf2vBjndl6CmACKqBf PkWYwJPfwbDxPy87+diWEiykH95wqM+wbLXRo07fw1RsNQPx9lyi1Ej2Dytej4KNj6xm QjppISFWLQuYQM6VdyXQEXsrLAgn3bTVFXDaj2o/T75iv4/w9pZSvTtF1Uy0KfFXPJzu ZWurqUQK5dKAbvTzDTwUnTlxwtsWWsbFyDk9mhAJIgMeyoWt/dhyioM4aI3IjKnBWFD2 aIYg== X-Gm-Message-State: AOAM533JFuF3fl7X3nvQ/tXx6aEy9Y/8N1t9ANpOSJnjGpwWGFc8FB+J NJDNeXjk0vAIRJ8eS4Gcl+rCAhCPiD8= X-Google-Smtp-Source: ABdhPJzo/bnvrWm8wfxOjGnCiane8GYg5WjgJCj0owZZHMfd2il20ZqQE+/nm6oBgi/wAzUq+nTcSw== X-Received: by 2002:ac8:1a07:: with SMTP id v7mr81740497qtj.329.1594633842553; Mon, 13 Jul 2020 02:50:42 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 24/25] qemu_migration.c: modernize qemuMigrationSrcConfirmPhase() Date: Mon, 13 Jul 2020 06:49:56 -0300 Message-Id: <20200713094957.1648405-25-danielhb413@gmail.com> In-Reply-To: <20200713094957.1648405-1-danielhb413@gmail.com> References: <20200713094957.1648405-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use g_autoptr() and remove both 'error' and 'cleanup' labels. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_migration.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5d64e9df98..78e64344f6 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2975,10 +2975,9 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, unsigned int flags, int retcode) { - qemuMigrationCookiePtr mig; + g_autoptr(qemuMigrationCookie) mig =3D NULL; virObjectEventPtr event; - int rv =3D -1; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); qemuDomainObjPrivatePtr priv =3D vm->privateData; qemuDomainJobInfoPtr jobInfo =3D NULL; =20 @@ -2997,7 +2996,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, = priv, cookiein, cookieinlen, QEMU_MIGRATION_COOKIE_STATS))) - goto cleanup; + return -1; =20 if (retcode =3D=3D 0) jobInfo =3D priv->job.completed; @@ -3026,7 +3025,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, } =20 if (flags & VIR_MIGRATE_OFFLINE) - goto done; + return 0; =20 /* Did the migration go as planned? If yes, kill off the domain objec= t. * If something failed, resume CPUs, but only if we didn't use post-co= py. @@ -3071,13 +3070,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, VIR_WARN("Failed to save status on vm %s", vm->def->name); } =20 - done: - qemuMigrationCookieFree(mig); - rv =3D 0; - - cleanup: - virObjectUnref(cfg); - return rv; + return 0; } =20 int --=20 2.26.2