From nobody Mon Feb 9 12:12:57 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=1594634424; cv=none; d=zohomail.com; s=zohoarc; b=NODpsodq+AXZzNfXymkYByF0YF42eL6cGIVtBgPLmLAk2qKCl4uo3i5RKApAv0gXVSTrFqB19jNyIdE5uJaNfRfdp0Bbh9Dp0fhaNQk381/U1J1o0pc4MX1ry1mxDua8ggPzU8kIm9KVq0LG5FFEZonhtzKRGiNwen9JBJ9cD8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594634424; 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=0JpBWn4NVUc8SYyA395TtmwbDV9nviy7iWl5eEaMRO4=; b=hXgB6ipIkf6bh+iB37fSox2+c+DCpeNW+Zjx2bz97yYwiZpA1Gvl4+2m/p1H1sCi+wD8JLOxMjC1xoep0BkhFE8rOX1CKM0jcUiBREeS1H4Hsc8D/E49dYbzCVXBErunnRtpb1zFTY2n+RsLEL1pf3Wsvo2yTHLThU9Uc7Sm9Ys= 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 1594634424091826.5935976871215; Mon, 13 Jul 2020 03:00:24 -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-465-hx3iXl4GOxO3eoWZVUYJMA-1; Mon, 13 Jul 2020 06:00:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1711D107ACCA; Mon, 13 Jul 2020 10:00:15 +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 B67FE79CE3; Mon, 13 Jul 2020 10:00:13 +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 3389A94EF7; Mon, 13 Jul 2020 10:00:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06DA0Ave007275 for ; Mon, 13 Jul 2020 06:00:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A583217B434; Mon, 13 Jul 2020 10:00:10 +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 029482166BA2 for ; Mon, 13 Jul 2020 10:00:06 +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 EDE01100E7DC for ; Mon, 13 Jul 2020 09:50:39 +0000 (UTC) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-Q-QObS6SOIqHEAD9uZGMfA-1; Mon, 13 Jul 2020 05:50:37 -0400 Received: by mail-qt1-f178.google.com with SMTP id j10so9407112qtq.11 for ; Mon, 13 Jul 2020 02:50:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 02:50:36 -0700 (PDT) X-MC-Unique: hx3iXl4GOxO3eoWZVUYJMA-1 X-MC-Unique: Q-QObS6SOIqHEAD9uZGMfA-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=0JpBWn4NVUc8SYyA395TtmwbDV9nviy7iWl5eEaMRO4=; b=MC9RVe4loVVGdMmJm0kRofJo0UPt5OF738xM52SeTqpRBS7c85ZEdQZDQi3QwVBuXS HWDbrqVY6Ikk+c3lXPWi7GMHyZIP/wyvzMgajd4GXgMG/QAFxzZaOQ749d2TjASrhXHa XLtDtqbXANa9oimlbbVDfYCBhuQccI3G8tXpwBMcHgJKmz5FBMXygFbroE6lQfczBoky +gmffcjawIXscssuVLvzjZVGEzkTErLXEOqvsR2pTwzyXZrpWHufcgzlZ9wFz8zqGJ53 kzt1vlfaATcuPM9l5EYtXxvtHGmqf4Um55Wgwqq1Liasy8ZaVASXG0sxQ9EGIEG27ooS 1tQQ== X-Gm-Message-State: AOAM5300E7rKYaJ4RwyV9oG8ahMxLFMTrS67lc9IQmt9pa8T86M//7bI 1PFFbBQPlLJUfEVGXiqOdmZ8ec8Vw58= X-Google-Smtp-Source: ABdhPJyIt2H45o4hiD3pyxUqDZGdbQJdaKR4z47UCB2coXZi4sshOkQUU9JDyCmmXs3DhA3ZIiM1OA== X-Received: by 2002:ac8:5249:: with SMTP id y9mr73673874qtn.99.1594633836862; Mon, 13 Jul 2020 02:50:36 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 20/25] qemu_migration.c: use g_auto* in qemuMigrationSrcPerformJob and Peer2Peer Date: Mon, 13 Jul 2020 06:49:52 -0300 Message-Id: <20200713094957.1648405-21-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.6 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_migration.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 9fa08617a2..d8f2aeb9f0 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4485,12 +4485,12 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr d= river, bool *v3proto) { int ret =3D -1; - virConnectPtr dconn =3D NULL; + g_autoptr(virConnect) dconn =3D NULL; bool p2p; virErrorPtr orig_err =3D NULL; bool offline =3D !!(flags & VIR_MIGRATE_OFFLINE); bool dstOffline =3D false; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); bool useParams; =20 VIR_DEBUG("driver=3D%p, sconn=3D%p, vm=3D%p, xmlin=3D%s, dconnuri=3D%s= , uri=3D%s, " @@ -4536,7 +4536,6 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr dri= ver, virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to connect to remote libvirt URI %s: %s"), dconnuri, virGetLastErrorMessage()); - virObjectUnref(cfg); return -1; } =20 @@ -4611,10 +4610,8 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr dr= iver, virErrorPreserveLast(&orig_err); qemuDomainObjEnterRemote(vm); virConnectUnregisterCloseCallback(dconn, qemuMigrationSrcConnectionClo= sed); - virObjectUnref(dconn); ignore_value(qemuDomainObjExitRemote(vm, false)); virErrorRestore(&orig_err); - virObjectUnref(cfg); return ret; } =20 @@ -4650,7 +4647,7 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, virObjectEventPtr event =3D NULL; int ret =3D -1; virErrorPtr orig_err =3D NULL; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); qemuDomainObjPrivatePtr priv =3D vm->privateData; =20 if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, @@ -4726,7 +4723,6 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, =20 cleanup: virObjectEventStateQueue(driver->domainEventState, event); - virObjectUnref(cfg); return ret; } =20 --=20 2.26.2