From nobody Sun Feb 8 12:01:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594633830; cv=none; d=zohomail.com; s=zohoarc; b=dkDxSOe9KTgO950s4jS1Isf9zGO97uKAZ9K/lMeZcksxEDqEIffofhkU4l5/UUvNLm/3FgMW6b9QXFt3y19W1na/TIOqm8/nx23Sknv+tLm3T8oV+cgcUhu6sRMVhRZ/7UptlSfnOk1uOjkxesAUNTrdiGyiH4fx6qjdno+aJ0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594633830; 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=BmjXdBa553wBlTACxevXX9VIHco2o7/ebTayjJUFCPM=; b=TgEdVoAW0OQIeOWIyvrRubTLnLMJPaHOVMTHQMWDvOXtVmTjjExpU1skEr+DLJZOe6tLKKy117Ln7OQQJ8HlBrkdtCTD1+WMcnVSXtpJ6QI9AubLhmoXmIkSfT/tXbE2mKEppCR+nLXtWz+hPbrYnWEdXIHBK3RyMQ0mWm2sfrc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594633830395359.9468169261721; Mon, 13 Jul 2020 02:50:30 -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-470-BAyc69XYOoGF8c_Cljr6ow-1; Mon, 13 Jul 2020 05:50:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F302A106B242; Mon, 13 Jul 2020 09:50:20 +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 D53BC78A45; Mon, 13 Jul 2020 09:50:20 +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 9773F1809563; Mon, 13 Jul 2020 09:50:20 +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 06D9oH1k005667 for ; Mon, 13 Jul 2020 05:50:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 651922026D67; Mon, 13 Jul 2020 09:50:17 +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 60A832026D5D for ; Mon, 13 Jul 2020 09:50:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 47314100E7CE for ; Mon, 13 Jul 2020 09:50:17 +0000 (UTC) Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-FGJ2Eor6OSWw-7f9TvLvew-1; Mon, 13 Jul 2020 05:50:14 -0400 Received: by mail-qv1-f65.google.com with SMTP id dm12so5483121qvb.9 for ; Mon, 13 Jul 2020 02:50:14 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 02:50:13 -0700 (PDT) X-MC-Unique: BAyc69XYOoGF8c_Cljr6ow-1 X-MC-Unique: FGJ2Eor6OSWw-7f9TvLvew-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=BmjXdBa553wBlTACxevXX9VIHco2o7/ebTayjJUFCPM=; b=L0dsgtNtAWJxIRkflHrsgke78FU6BiVUYYTA9FQ7HaL+oooToyc8yoa2JSwmh/QR/Y MvIP0pfEHH6XFQToFXvU54Z20Az9QSEQ+HzxYli9Fdlpsoq0rrJo9Hs4s6f2N1mAj/FO 92MEbKcbEmye8Z3GDSHnhLDW5nyiwhqmJ5cWfyNuq6T/2YhOFCvxY8WXl9COQbqM6a66 gAViHHA+ui7hzSAn6cDXvvZslF+iEkiXdAH96gA45f4P/LsxCakVIvzr+V5aFcWlNi1Y bGyZz1wVcKp6SyPbNtH7sl4gdh/9ScBMcEzhGDGnQlJsXCwvjO6k9/2/d5DmPpYQjJvm 7dmA== X-Gm-Message-State: AOAM530oU6+ilqj+GrBqN/GWWSVjjfqvN73kKdrQ4f8xmE6g0EtEffYp SyTi5NXh8o/sJ3pA9BYvECgadtXGMUc= X-Google-Smtp-Source: ABdhPJz16QSX/C1njPNWtuafzVEClkuHFItRhWOrlLUT7oQjR16VN/uuw7GFXxWjgGCY3PyOdZ3wGA== X-Received: by 2002:ad4:476a:: with SMTP id d10mr79862007qvx.13.1594633813650; Mon, 13 Jul 2020 02:50:13 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 05/25] qemu_driver.c: modernize qemuDomainMigratePrepare3() Date: Mon, 13 Jul 2020 06:49:37 -0300 Message-Id: <20200713094957.1648405-6-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.14 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() on pointers and remove the unneeded 'cleanup' label. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6b47e28e99..4fe122f8ae 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12397,10 +12397,9 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, const char *dom_xml) { virQEMUDriverPtr driver =3D dconn->privateData; - virDomainDefPtr def =3D NULL; + g_autoptr(virDomainDef) def =3D NULL; g_autofree char *origname =3D NULL; - qemuMigrationParamsPtr migParams =3D NULL; - int ret =3D -1; + g_autoptr(qemuMigrationParams) migParams =3D NULL; =20 virCheckFlags(QEMU_MIGRATION_FLAGS, -1); =20 @@ -12411,30 +12410,25 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Tunnelled migration requested but invalid " "RPC method called")); - goto cleanup; + return -1; } =20 if (!(migParams =3D qemuMigrationParamsFromFlags(NULL, 0, flags, QEMU_MIGRATION_DESTINAT= ION))) - goto cleanup; + return -1; =20 if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) - goto cleanup; + return -1; =20 if (virDomainMigratePrepare3EnsureACL(dconn, def) < 0) - goto cleanup; - - ret =3D qemuMigrationDstPrepareDirect(driver, dconn, - cookiein, cookieinlen, - cookieout, cookieoutlen, - uri_in, uri_out, - &def, origname, NULL, 0, NULL, 0, - migParams, flags); + return -1; =20 - cleanup: - qemuMigrationParamsFree(migParams); - virDomainDefFree(def); - return ret; + return qemuMigrationDstPrepareDirect(driver, dconn, + cookiein, cookieinlen, + cookieout, cookieoutlen, + uri_in, uri_out, + &def, origname, NULL, 0, NULL, 0, + migParams, flags); } =20 static int --=20 2.26.2