From nobody Sun Feb 8 16:07:17 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=1594633874; cv=none; d=zohomail.com; s=zohoarc; b=R7JHgaEIO5jxgJDNjPzrR9u/sl7/BRUX+TdZWT/2EJTDI2wH9/kmDZMuBCk5x6W5BybZ0WPWeSRmiQKs/yNJqfB2Wj35cPrk4sTWe964DiUuXHs4XyKhv+hYHVOMAcdtJ4bibfMaIEVcYrvXrSJ9pm190tRKvJ/NQ09jeGGHHII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594633874; 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=ldm+jEmt8OkqqVdBeB8J2UtZiEkbPlDY1Zfyg5Swxvg=; b=ei94SXWBMwn2oN1IEBMa4eZXl857cD5HASkQgddTrrDKRhKW+s3u1KZPXdb6jvzRJLsY26kBGOvowU1EG6Gz5z6ZJlqNTLtkoiTnSfMmb7ULQjEjTz1dy2fdsUa9o7OAM5KniQGFBNGqgcHZwEsF6TtTHH0UUcTVz4UGoc5mRP8= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594633874616121.76514770148401; Mon, 13 Jul 2020 02:51:14 -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-304-yY692DnJOLOEKdhxAklQyg-1; Mon, 13 Jul 2020 05:51:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0229F80BCA8; Mon, 13 Jul 2020 09:51:03 +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 CEACD1010404; Mon, 13 Jul 2020 09:51:02 +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 9D0E794F1C; Mon, 13 Jul 2020 09:51:02 +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 06D9oidR005982 for ; Mon, 13 Jul 2020 05:50:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id A86132026D5D; Mon, 13 Jul 2020 09:50:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C32220A0520 for ; Mon, 13 Jul 2020 09:50:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 66AE68007CD for ; Mon, 13 Jul 2020 09:50:44 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-s_jmOpkiPfSLblw5KyIvdg-1; Mon, 13 Jul 2020 05:50:41 -0400 Received: by mail-qt1-f193.google.com with SMTP id i3so9403558qtq.13 for ; Mon, 13 Jul 2020 02:50:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 02:50:40 -0700 (PDT) X-MC-Unique: yY692DnJOLOEKdhxAklQyg-1 X-MC-Unique: s_jmOpkiPfSLblw5KyIvdg-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=ldm+jEmt8OkqqVdBeB8J2UtZiEkbPlDY1Zfyg5Swxvg=; b=WW3jtsedlJQVDUFfoQHorzPs7HbKA4+bXUB9x1+hYuGJFu7x48eaVKl+oFkyF+KHxS fJGJ4D0SDVytGWqvPyG0ooBZgYdsiY/pm1E4LdrYWkOOSb3jXFswiwH9Za6wj5Zivnwb VJUEOtwFEed9LgWqbY0b/9Rgpfx/7h9Ui9/P67HYMlxwfBqTB2CVbs4mjWKuEfQqBmIb oh6568YivXBNvWlDIaqoYwv0tsS86Y3Qgc9CDxL2MmD7plXsrJPFqABypO5Trd/Q46uD 01CE2XQzD5Gczi3sKPLJyr7oe+1siyypQWrvL9U30nbplAUYr1zjM7fZEzkzSu9X5QRR Aw0w== X-Gm-Message-State: AOAM531H3C8nA/5aXKemZjH7kcpTCDcG0Jz5N35GsPUx0T/AfG3w9e8m NL/pbMQWjPUgAGkJfpal6bEzXI4x16c= X-Google-Smtp-Source: ABdhPJyyQGHrqOOVuJOJJAg+77x0rf78GjI5XGklpMNPHg3YpLq/XfBl5NbaYOE3fsGXRCi1WZr+qg== X-Received: by 2002:aed:3883:: with SMTP id k3mr86218764qte.365.1594633841157; Mon, 13 Jul 2020 02:50:41 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 23/25] libvirt-domain.c: g_autofree in virDomainMigrate() and virDomainMigrate2() Date: Mon, 13 Jul 2020 06:49:55 -0300 Message-Id: <20200713094957.1648405-24-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.84 on 10.5.11.22 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/libvirt-domain.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index e379623ce4..5b76f1ab66 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3553,7 +3553,7 @@ virDomainMigrate(virDomainPtr domain, if (flags & VIR_MIGRATE_PEER2PEER) { if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, VIR_DRV_FEATURE_MIGRATION_P2P)) { - char *dstURI =3D NULL; + g_autofree char *dstURI =3D NULL; if (uri =3D=3D NULL) { dstURI =3D virConnectGetURI(dconn); if (!dstURI) @@ -3562,11 +3562,8 @@ virDomainMigrate(virDomainPtr domain, =20 VIR_DEBUG("Using peer2peer migration"); if (virDomainMigrateUnmanaged(domain, NULL, flags, dname, - uri ? uri : dstURI, NULL, bandwi= dth) < 0) { - VIR_FREE(dstURI); + uri ? uri : dstURI, NULL, bandwi= dth) < 0) goto error; - } - VIR_FREE(dstURI); =20 ddomain =3D virDomainLookupByName(dconn, dname ? dname : domai= n->name); } else { @@ -3712,17 +3709,14 @@ virDomainMigrate2(virDomainPtr domain, if (flags & VIR_MIGRATE_PEER2PEER) { if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, VIR_DRV_FEATURE_MIGRATION_P2P)) { - char *dstURI =3D virConnectGetURI(dconn); + g_autofree char *dstURI =3D virConnectGetURI(dconn); if (!dstURI) return NULL; =20 VIR_DEBUG("Using peer2peer migration"); if (virDomainMigrateUnmanaged(domain, dxml, flags, dname, - dstURI, uri, bandwidth) < 0) { - VIR_FREE(dstURI); + dstURI, uri, bandwidth) < 0) goto error; - } - VIR_FREE(dstURI); =20 ddomain =3D virDomainLookupByName(dconn, dname ? dname : domai= n->name); } else { --=20 2.26.2