From nobody Mon Feb 9 09:28:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606762568; cv=none; d=zohomail.com; s=zohoarc; b=NLJouph/zpCnxCjK8Ibz/pToK2ub+uM3n7B/neboy4NoNuiCCBDTktDo4PvqmBpIdIjlGEef4B7mn6I/QD8HN8uKE5LJGN4fAPJy/mX/i1qZUkvoI7HOaJoLLp9ddWpOroSNyreb0g3ezDuwK0GfuV8+umxoQhiGeu7Mcsomlfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606762568; h=Content-Type:Content-Transfer-Encoding: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=iP7M37HGBVB69AbrLnh5f1MHEwMXtSlaNI8uVEO/p7o=; b=gHj5p1qPdA11eZhiLncNsyxuYvQx3yfWhI2X6TSpjZJfhKwRhyrdhv9d7Dt/UzoEiYe89f0pUz7unxpqfNVEEGA19eHtavAqfbN4D0l8oNG9HovaT5c432GGjZJajh/GGSTHeNvP0QI0gIwEyBMr0Dl27HBqMO0z7k0FOOCt0tE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606762568970700.5872496706788; Mon, 30 Nov 2020 10:56:08 -0800 (PST) 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-482-QU4oFyViN9-My7UJUytvZQ-1; Mon, 30 Nov 2020 13:56:05 -0500 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 94D551842141; Mon, 30 Nov 2020 18:55:59 +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 44D1B5D6AB; Mon, 30 Nov 2020 18:55:59 +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 1266C4EA6C; Mon, 30 Nov 2020 18:55:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AUItjL4014178 for ; Mon, 30 Nov 2020 13:55:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id D339B60C67; Mon, 30 Nov 2020 18:55:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2682660BE2 for ; Mon, 30 Nov 2020 18:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606762567; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iP7M37HGBVB69AbrLnh5f1MHEwMXtSlaNI8uVEO/p7o=; b=GUL4uZ9oK7ooA0SM9HkLt+aaaG87akR4rsvGHsOu+3nfHQvxCtzz31RawZU5QYygVaUXX3 OQVgVCcofQibXNFE4deTb6epxIlW/obCJka0BxUubL3x6HIAFbMQiYcgXZURMAzb8Cy5aa rs/Mg/1OK9/YZtoatE43HHYyu4ykq/A= X-MC-Unique: QU4oFyViN9-My7UJUytvZQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/24] qemuMonitorJSONSetMigrationCapabilities: Refactor cleanup Date: Mon, 30 Nov 2020 19:55:16 +0100 Message-Id: <6e9f72cc7c8e0234d3b52850308d757986d88de0.1606762033.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use automatic memory freeing and remove the 'cleanup' label and 'ret' variable. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index fe5c26f37f..8fd53a565d 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7133,27 +7133,21 @@ int qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon, virJSONValuePtr *caps) { - int ret =3D -1; - virJSONValuePtr cmd =3D NULL; - virJSONValuePtr reply =3D NULL; + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; - cmd =3D qemuMonitorJSONMakeCommand("migrate-set-capabilities", - "a:capabilities", caps, - NULL); - if (!cmd) - goto cleanup; + if (!(cmd =3D qemuMonitorJSONMakeCommand("migrate-set-capabilities", + "a:capabilities", caps, + NULL))) + return -1; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + return -1; if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; + return -1; - ret =3D 0; - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; + return 0; } --=20 2.28.0