From nobody Sun Feb 8 12:41:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1594633865; cv=none; d=zohomail.com; s=zohoarc; b=Q/zfNlW70ogIYXwKCbyNIWCB6xcNNg7XGfub3vb5pu/AGidCkPezP8RwftRvRt1l9qAOEjxTJXrAeC3uWxc5vIJdWFqqgeJiMZijUKg1ffIfjcm0hdEHvnn8QCvZdr+BlNnsv2T47dqOB7wE+T9+R2VKxdK+R8wWXV0CnXMqBTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594633865; 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=+T+uggtH3/KKnMc1f2ixpv3I5WOOMvXCFdeEGesK2DE=; b=QQKxGknmra83iJvJseYddt2jTKvEsamXuPBDbhZCLniTJH6DUrpmZqzRr56p1e5xrB+xTcwXBK9yMmUM9cfuXcMP7+bANBy/2Gxsf9fBzEYAoc0vVqiyf4S/lNph+pDbTitfeQJRS7tYzBm2OIs6DSVBaUibNATmIATJn8OOI8I= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594633865150984.7089631189235; Mon, 13 Jul 2020 02:51:05 -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-225-ctJXnS_uN8qurNsUUG4OAw-1; Mon, 13 Jul 2020 05:51:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 469AA8027F6; Mon, 13 Jul 2020 09:50:55 +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 23CB927DE98; Mon, 13 Jul 2020 09:50:55 +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 EB1FC94F12; Mon, 13 Jul 2020 09:50:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06D9ofmd005948 for ; Mon, 13 Jul 2020 05:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 533692026D5D; Mon, 13 Jul 2020 09:50:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3930A20A052E for ; Mon, 13 Jul 2020 09:50:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 1ECDB80CC3A for ; Mon, 13 Jul 2020 09:50:41 +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-234-30dPULGTPKqesoWXdf9f_A-1; Mon, 13 Jul 2020 05:50:38 -0400 Received: by mail-qt1-f195.google.com with SMTP id e12so9422590qtr.9 for ; Mon, 13 Jul 2020 02:50:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 02:50:37 -0700 (PDT) X-MC-Unique: ctJXnS_uN8qurNsUUG4OAw-1 X-MC-Unique: 30dPULGTPKqesoWXdf9f_A-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=+T+uggtH3/KKnMc1f2ixpv3I5WOOMvXCFdeEGesK2DE=; b=QWM8KTxSLrpajOy5IlPmXDMRqlCturQEI2GbQxYsJob4HtdoaBf2tmBMRdpWMBupJK sE/5HymsGjZtT2O7CZ1Wiwo3gtBpWz7asuoWj9skhpay5pSGTR17oIw0866ucNKNhUXP xZn1ykvbZ9J0+Kosbkkc1TccHFh/T7JMZXsRlshaH8P4Vw695/58A3kMBFHP+i9J+xcF Ha2+G+Qy5j58WpTe2TGlcDRN966OZ0RYIqq8/vww9SMAIR1KgBniR3xfivV4FvmawiBt 762atoBxYd2ww4KAFi4iDpFxytwIwYNVp+vQzR4IQxrm7MD3zCMXZyXGkRqC4uhaYVzB 7VQQ== X-Gm-Message-State: AOAM530hPX1nZDlAUnTiFunk8Tvi5hr1gisqWBfAqTQzezAq3gE16TBS zkPpXmNKOT0F81fqmNhproMjABU2Xa8= X-Google-Smtp-Source: ABdhPJwMsAlkROJsopwg4qKXdB3KAv0N4YZTAB/bXDvxfXwRrpDIRWtpbSU2zysoT0dbc6y6NAb/Qw== X-Received: by 2002:ac8:2672:: with SMTP id v47mr78382370qtv.330.1594633838224; Mon, 13 Jul 2020 02:50:38 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 21/25] qemu_migration.c: modernize qemuMigrationDstPersist() Date: Mon, 13 Jul 2020 06:49:53 -0300 Message-Id: <20200713094957.1648405-22-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.78 on 10.11.54.4 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.15 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 the 'cleanup' label. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_migration.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d8f2aeb9f0..c8bb0a6060 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4926,13 +4926,12 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver, qemuMigrationCookiePtr mig, bool ignoreSaveError) { - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainDefPtr vmdef; - virDomainDefPtr oldDef =3D NULL; + g_autoptr(virDomainDef) oldDef =3D NULL; unsigned int oldPersist =3D vm->persistent; virObjectEventPtr event; - int ret =3D -1; =20 vm->persistent =3D 1; oldDef =3D vm->newDef; @@ -4953,19 +4952,14 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver, VIR_DOMAIN_EVENT_DEFINED_ADD= ED); virObjectEventStateQueue(driver->domainEventState, event); =20 - ret =3D 0; - - cleanup: - virDomainDefFree(oldDef); - virObjectUnref(cfg); - return ret; + return 0; =20 error: virDomainDefFree(vm->newDef); vm->persistent =3D oldPersist; vm->newDef =3D oldDef; oldDef =3D NULL; - goto cleanup; + return -1; } =20 =20 --=20 2.26.2