From nobody Thu May 2 05:33:14 2024 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=1595020961; cv=none; d=zohomail.com; s=zohoarc; b=lOL1HvvE/iSkheVwp7RsJYuG93VvGg/OVPzfU1E0pOyAqkmUcG6TuFzmZR6BrLjNdlvxX4Fdgmawr/98M37fMCOMVNE8LQ7j9/6o6Avogtdp9AyBXyk7xTaQ56zWcx7h/RtId1Gdr9YEFoDumJ1t7SWHhSR3jNjIy1v+vuX0ftg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595020961; 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=A31E5Ild34HjWiWzdEqG40yqqDNRICYoYI9NoI48Pk8=; b=QJbOq1oFBGRtZm+O+kBFbs2xiBrFfLQQmkvh+nPSbh195iS4QkVlsgZdYeAsp+YWJs0Xc3BavmLR8AH6boCHT/YAHyfbDPkioyhLwqvc2IZ53tX65Os+KTgiTjlx0yR4pniCFx/xu+F4wjt5g777V7Ggsv6+kHg4e3DlpvTdErA= 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 1595020961386593.2830344046109; Fri, 17 Jul 2020 14:22:41 -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-402-nMUUZylEOLa-HcPU2b_sHA-1; Fri, 17 Jul 2020 17:22:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D2D51800D42; Fri, 17 Jul 2020 21:22:32 +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 DEAC819C58; Fri, 17 Jul 2020 21:22:31 +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 543649624C; Fri, 17 Jul 2020 21:22:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06HLGDh6019531 for ; Fri, 17 Jul 2020 17:16:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5BAE01140FE; Fri, 17 Jul 2020 21:16:13 +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 572741140FA for ; Fri, 17 Jul 2020 21:16:10 +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 170A51012443 for ; Fri, 17 Jul 2020 21:16:10 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-by6V51wgOMCatD6iRYAyTg-1; Fri, 17 Jul 2020 17:16:07 -0400 Received: by mail-qk1-f177.google.com with SMTP id k18so10074053qke.4 for ; Fri, 17 Jul 2020 14:16:07 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:9447:1f8b:580e:61d9:b1a4]) by smtp.gmail.com with ESMTPSA id x19sm11847162qtc.36.2020.07.17.14.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 14:16:06 -0700 (PDT) X-MC-Unique: nMUUZylEOLa-HcPU2b_sHA-1 X-MC-Unique: by6V51wgOMCatD6iRYAyTg-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=A31E5Ild34HjWiWzdEqG40yqqDNRICYoYI9NoI48Pk8=; b=iJ9qqF5dSncHUvxyl+SZi/IHtJGOcG/oZ1kSse8Jra1MlsjnPv0OD8c5Q/sdHDKBwX ss13zNlF0/ylgXL8XNe1zEdvh5MyliPZe4jVGT3wJuFTbA4SDszyq/xiMkNPoydkUw7w f/2YrL9rMLsE5nB8XOKds3HNhRwo8B3063dvvYgeM9Tw2ee9H+/Mh1RyMQWDYvX7e/cP Wap/ZwwfP6WrFWTeu1spmRV3YC65BWqXP4x3vj28czYqFGGF+gDJAWrrxG3PdiY4b8bW r573wke2ervqCsYGUWNb8i+7w0UQUeIwUs/DyPgZI7adtKi78SA7i/XajZblq1MDjMB0 dYIQ== X-Gm-Message-State: AOAM5319gbIdGrZtIdY/WTmtDRii80FyXFAmj4yX15fiGmbvyuv2cmgC aNf7+EK5bK4frdq8eNMpg+Y6R38CHkA= X-Google-Smtp-Source: ABdhPJzYlxUfd3EHbO/0JHcbJCvWZlEZpDGVhJExtC/e15/QwUkti9cv5A7RPVwFcHx4F1jg/d0abw== X-Received: by 2002:a05:620a:2007:: with SMTP id c7mr10781129qka.208.1595020566646; Fri, 17 Jul 2020 14:16:06 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 1/5] qemu_process.h: register AUTOPTR_CLEANUP_FUNC for qemuProcessQMPPtr Date: Fri, 17 Jul 2020 18:15:52 -0300 Message-Id: <20200717211556.1024748-2-danielhb413@gmail.com> In-Reply-To: <20200717211556.1024748-1-danielhb413@gmail.com> References: <20200717211556.1024748-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Next patches will use g_autoptr() in qemuProcessQMPPtr pointers for some cleanups in QMP code. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Jiri Denemark --- src/qemu/qemu_process.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 15e67b9762..125508f9fe 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -234,5 +234,6 @@ qemuProcessQMPPtr qemuProcessQMPNew(const char *binary, bool forceTCG); =20 void qemuProcessQMPFree(qemuProcessQMPPtr proc); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuProcessQMP, qemuProcessQMPFree); =20 int qemuProcessQMPStart(qemuProcessQMPPtr proc); --=20 2.26.2 From nobody Thu May 2 05:33:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1595020754; cv=none; d=zohomail.com; s=zohoarc; b=AoBan8LuOiFnuw8Ukacq35R/4m+EWrXKsO5S20+lYUY0X+QEP8O7yg3pfP90j4NQBD5Z4ka0cG2/qrz48v+0ohukgn5z8b0sQRx73wNRwFLnBwYv+1MbsK3KgaVCnQ0RRQ/ZFN2Nth/HWmoykhpyCvoAg+qRSX39Iql27uaFd5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595020754; 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=9sTrxxyrWXQJproU9jX3RPudIVglhDl+ncmsfBYrO8I=; b=j1CRRw9vGnqv8o1oNGqT7+deUtwtDRJR1k2L37iFEo538Req6vwIRVZf7K/gkSHdKHAy4tKwchVFnP7SwYp9oDpRHmslH2BGP7//W9CLkkNZOqU2ylup184rNDPG9LkR8peWrCtDAeqkfQgSWSALMU/Av+zdd9Hwn+TP+uyDvdM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595020754681388.3274751399334; Fri, 17 Jul 2020 14:19: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-293-XrpUyB6sMl2dhK0ETKBy2g-1; Fri, 17 Jul 2020 17:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1768810059A9; Fri, 17 Jul 2020 21:19:06 +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 AC35D7554E; Fri, 17 Jul 2020 21:19:05 +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 4CDC49624C; Fri, 17 Jul 2020 21:19:05 +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 06HLGDZV019529 for ; Fri, 17 Jul 2020 17:16:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39B7E2166BA4; Fri, 17 Jul 2020 21:16:13 +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 35B262166BA3 for ; Fri, 17 Jul 2020 21:16:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 1CFD9800399 for ; Fri, 17 Jul 2020 21:16:11 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-303-HQNMXFBoMfqS2TLMz7w7dQ-1; Fri, 17 Jul 2020 17:16:08 -0400 Received: by mail-qt1-f194.google.com with SMTP id w27so8726863qtb.7 for ; Fri, 17 Jul 2020 14:16:08 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:9447:1f8b:580e:61d9:b1a4]) by smtp.gmail.com with ESMTPSA id x19sm11847162qtc.36.2020.07.17.14.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 14:16:07 -0700 (PDT) X-MC-Unique: XrpUyB6sMl2dhK0ETKBy2g-1 X-MC-Unique: HQNMXFBoMfqS2TLMz7w7dQ-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=9sTrxxyrWXQJproU9jX3RPudIVglhDl+ncmsfBYrO8I=; b=LUvRP74b1Y9mE8tTdZ1KlhzXNCr5w9vaDE17QnVf/IWnWgrwTgVWIcJF6y4fMS66AY uR8YzNUB9XdESTJ+sn1LOkSjAV3ZIQvg4C6UgXPJtwZ6HD1YkkjuBicAMvKniAYVppCt m5DTrjYuFzmSvFugOlyl+5KFIKW4RRxBhV+J/E0+2YnUuzJAO3AdHtM1PU02xcHzkmeW MnMDI7eOXKoUJS50xxC77KhvU7G1mfyEbCj+lfEsPEgUvXFxHaHjDQ+s67gTraPcXbdd J0NViyX4LZINuqHEeNVZElRBR+S3klZ3yKjiYtJ1APZKI3Nlz0Bja6M3JAIsmPQTAvyx NxCQ== X-Gm-Message-State: AOAM533fS123jB1IMl7PkJEUseb9EuQ/Sqnq+JN25zPaErtWsYa+MgI7 bIGRVeWtM7EQH/y89FuTD5bY6riSk08= X-Google-Smtp-Source: ABdhPJyYCKFmSFJ+dU9c5j0RHXkWdNkOyycEhLQHSgFt8N/dGovH6PYjpfkj/GWauiZ9x5EHFjGD0A== X-Received: by 2002:ac8:728b:: with SMTP id v11mr13194673qto.297.1595020568092; Fri, 17 Jul 2020 14:16:08 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 2/5] qemu_process.c: modernize qemuProcessQMPNew() Date: Fri, 17 Jul 2020 18:15:53 -0300 Message-Id: <20200717211556.1024748-3-danielhb413@gmail.com> In-Reply-To: <20200717211556.1024748-1-danielhb413@gmail.com> References: <20200717211556.1024748-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.11 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 Reviewed-by: Jiri Denemark --- src/qemu/qemu_process.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 70fc24b993..a11eedda16 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8395,8 +8395,7 @@ qemuProcessQMPNew(const char *binary, gid_t runGid, bool forceTCG) { - qemuProcessQMPPtr ret =3D NULL; - qemuProcessQMPPtr proc =3D NULL; + g_autoptr(qemuProcessQMP) proc =3D NULL; const char *threadSuffix; g_autofree char *threadName =3D NULL; =20 @@ -8404,7 +8403,7 @@ qemuProcessQMPNew(const char *binary, binary, libDir, runUid, runGid, forceTCG); =20 if (VIR_ALLOC(proc) < 0) - goto cleanup; + return NULL; =20 proc->binary =3D g_strdup(binary); proc->libDir =3D g_strdup(libDir); @@ -8421,13 +8420,9 @@ qemuProcessQMPNew(const char *binary, threadName =3D g_strdup_printf("qmp-%s", threadSuffix); =20 if (!(proc->eventThread =3D virEventThreadNew(threadName))) - goto cleanup; - - ret =3D g_steal_pointer(&proc); + return NULL; =20 - cleanup: - qemuProcessQMPFree(proc); - return ret; + return g_steal_pointer(&proc); } =20 =20 --=20 2.26.2 From nobody Thu May 2 05:33:14 2024 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=1595020798; cv=none; d=zohomail.com; s=zohoarc; b=ksWaM2wsqMbgWigks5+oGNHAUABWoRYJTXWvCSYD+cZAmBfwh68D6qqkUxx+K1ITtnJkii5x1vImD6ZFXPYMbGVt7caUNiZwOBR717vD1W5FQRRmVvO2yDkAM6u1WhQm+ffO1bfjImbIEg7J1fsrCO5RbykRNrYcSvmedxe3N+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595020798; 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=HxCOILoaySTp7nfWTlLVxn/PTvqCZPDEfwq3vzxRgZ0=; b=TaJJ3zC1WH/Abuyq04UMkAmRtSCmI1JH1w6PmwUTfQVAb0ZVhWIAdPuuZjuyoVKxEHJcVZWFa+RIPX1DNaBJceF6WfNxOOoK5IKow6R/v+JCXDlw2laXh0ASYgl36Mxg1Gd7DtpSAhQ7pFD0TNnKv3GirIDoxiYHcJ9Cb+arn7Q= 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 1595020798852232.8183110686216; Fri, 17 Jul 2020 14:19:58 -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-298-mWz9RT_fPn6GtN-0mD3PhQ-1; Fri, 17 Jul 2020 17:19:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACE041080; Fri, 17 Jul 2020 21:19:49 +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 8981F5C1D4; Fri, 17 Jul 2020 21:19:49 +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 55A2F1809557; Fri, 17 Jul 2020 21:19:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06HLGDib019530 for ; Fri, 17 Jul 2020 17:16:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5BB3A11410C; Fri, 17 Jul 2020 21:16:13 +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 572D4114108 for ; Fri, 17 Jul 2020 21:16:12 +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 7666080CC2C for ; Fri, 17 Jul 2020 21:16:12 +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-211-Fv1X8Ta-OiupxlGKsBuVAA-1; Fri, 17 Jul 2020 17:16:10 -0400 Received: by mail-qt1-f195.google.com with SMTP id a32so8727050qtb.5 for ; Fri, 17 Jul 2020 14:16:10 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:9447:1f8b:580e:61d9:b1a4]) by smtp.gmail.com with ESMTPSA id x19sm11847162qtc.36.2020.07.17.14.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 14:16:09 -0700 (PDT) X-MC-Unique: mWz9RT_fPn6GtN-0mD3PhQ-1 X-MC-Unique: Fv1X8Ta-OiupxlGKsBuVAA-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=HxCOILoaySTp7nfWTlLVxn/PTvqCZPDEfwq3vzxRgZ0=; b=jY45FHia2bUdMmVbVIXJRYwKDwYJfxigbcG2NBo6MLmhiffjqAUPNBsan/QekKwYnQ /hBHsMQMtuCjpJOVQ/G+6lOw/VvlyZqOgY+DpdiHpPSab/CudSJjT1H9kHwJu3eSDXgq Vd3SOeQuB9tO+zU/DQGoRNgkPbQ0E/D9Z+R/Om4u7cnfLc992R8I7YUTPV5HZR/EhHQd 8kPAl6DG/saOOC8pVpH/8y6/iU9FqDj+4dPMBiy0WXDS6nFCZLhTEwFc4b/+QmX0QCXN ldIaxgxwpXzkne+UAyCyI9wYxZZwrefS0qwVcK+EmU4w+hOFOZcsT7dtha6dL1FCo5YW lF/A== X-Gm-Message-State: AOAM531Wf1ABQowbCm0GHyzLzPO8opx2KRrHlwn/nbHHNk/supKnxCjL znRwdIVQ0JF7BtZt+vy7FXmbwgJ9Rl4= X-Google-Smtp-Source: ABdhPJxSNoRlCnHw+MSRuAcGlzzb7ng6o7+IsP4ePPwn04wkzPAljpRMnriwm9tfFFZyJ845MCkwOw== X-Received: by 2002:ac8:134a:: with SMTP id f10mr12786968qtj.131.1595020569530; Fri, 17 Jul 2020 14:16:09 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 3/5] qemu_driver.c: modernize qemuConnectCPUModelBaseline() Date: Fri, 17 Jul 2020 18:15:54 -0300 Message-Id: <20200717211556.1024748-4-danielhb413@gmail.com> In-Reply-To: <20200717211556.1024748-1-danielhb413@gmail.com> References: <20200717211556.1024748-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.16 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 Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d185666ed8..d73d093465 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13342,50 +13342,44 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCa= ps, virCPUDefPtr *cpus, int ncpus) { - qemuProcessQMPPtr proc; - virCPUDefPtr ret =3D NULL; - virCPUDefPtr baseline =3D NULL; + g_autoptr(qemuProcessQMP) proc =3D NULL; + g_autoptr(virCPUDef) baseline =3D NULL; qemuMonitorCPUModelInfoPtr result =3D NULL; size_t i; =20 if (!(proc =3D qemuProcessQMPNew(virQEMUCapsGetBinary(qemuCaps), libDir, runUid, runGid, false))) - goto cleanup; + return NULL; =20 if (qemuProcessQMPStart(proc) < 0) - goto cleanup; + return NULL; =20 if (VIR_ALLOC(baseline) < 0) - goto cleanup; + return NULL; =20 if (virCPUDefCopyModel(baseline, cpus[0], false)) - goto cleanup; + return NULL; =20 for (i =3D 1; i < ncpus; i++) { if (qemuMonitorGetCPUModelBaseline(proc->mon, baseline, cpus[i], &result) < 0) - goto cleanup; + return NULL; =20 if (qemuConnectStealCPUModelFromInfo(baseline, &result) < 0) - goto cleanup; + return NULL; } =20 if (expand_features) { if (qemuMonitorGetCPUModelExpansion(proc->mon, QEMU_MONITOR_CPU_MODEL_EXPANSI= ON_FULL, baseline, true, false, &result= ) < 0) - goto cleanup; + return NULL; =20 if (qemuConnectStealCPUModelFromInfo(baseline, &result) < 0) - goto cleanup; + return NULL; } =20 - ret =3D g_steal_pointer(&baseline); - - cleanup: - qemuProcessQMPFree(proc); - virCPUDefFree(baseline); - return ret; + return g_steal_pointer(&baseline); } =20 =20 --=20 2.26.2 From nobody Thu May 2 05:33:14 2024 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=1595020801; cv=none; d=zohomail.com; s=zohoarc; b=Wpa8fak60ebnFQr9wpI9L7c08J9zgY0wvyijvJTWY/KYu4AgHBP3MIN22XZQbLoMEgMHNXvBhZQPxDCSOCoeYuPyH65/5aYHKORsRMfs9R1p/D/A6PAuxR6oKrMNyXledMf+JoZ08Iwr3ZyfpjvhdfcEq+VcS1qraiTNxTMvQr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595020801; 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=PKtMdppRzg88y+tPJgeZgL2wpefLMuThhOQJj4Y414Q=; b=W1CJm8ufDzUN+1pNIAPGkUEc63slNKRayh65INKhY79TQ0hYH3GALQUxggT28HXSlbTcKZTNDwA/9lOCFcwPV5P6LbiEWCrLWZPSCyhauUrmaOECbKLNnQSFDaKEfofxzFonC0NP30Snq00UBVTDKgSg159TGr0eG+nz0+6Y4MU= 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1595020801157449.3951946972836; Fri, 17 Jul 2020 14:20:01 -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-275-xHKZGLghPx-iXqzQIh7Kwg-1; Fri, 17 Jul 2020 17:19:58 -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 172BC106B244; Fri, 17 Jul 2020 21:19:52 +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 EB6067BD4E; Fri, 17 Jul 2020 21:19:51 +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 B7D2796255; Fri, 17 Jul 2020 21:19:51 +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 06HLGFZ9019552 for ; Fri, 17 Jul 2020 17:16:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id D46562097D60; Fri, 17 Jul 2020 21:16:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC2AD2097D64 for ; Fri, 17 Jul 2020 21:16:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 982651832D21 for ; Fri, 17 Jul 2020 21:16:13 +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-70-CDPIXczVMAem8jX5m2XWbA-1; Fri, 17 Jul 2020 17:16:11 -0400 Received: by mail-qt1-f195.google.com with SMTP id e12so8724707qtr.9 for ; Fri, 17 Jul 2020 14:16:11 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:9447:1f8b:580e:61d9:b1a4]) by smtp.gmail.com with ESMTPSA id x19sm11847162qtc.36.2020.07.17.14.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 14:16:10 -0700 (PDT) X-MC-Unique: xHKZGLghPx-iXqzQIh7Kwg-1 X-MC-Unique: CDPIXczVMAem8jX5m2XWbA-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=PKtMdppRzg88y+tPJgeZgL2wpefLMuThhOQJj4Y414Q=; b=jk/G9ph+U5Hx5GCMDD4BiqxnOWRJ6RBmcha5Z1hyZ1aTBVtknyCeBebO5OC2A+RZQt qlihwCeuvQSD8OucNSrMxboYo8UpelHub+7zv3OXH9WIeuDNAjiHL3WPXbKbPDYLKuAs bHw3ILCJJF3bB/PzxrbVQCuWQZUF6IpfVCYM3w8n2ASRvBjJsuaPwwVNXufe4oORrF6K odWUP6uY70sCy+xz75BTZX99Ly5ZIg+V4qxb8g6dO1dfi4SuTwVzZHBElhzlt1SxtuWd FUU9NWKDV+uPRPw1KujNyZ/HZq1X88pbsjeUVIKdLAhIa0IQvPHKA2TP1Cs4ZJdoo927 2+Mg== X-Gm-Message-State: AOAM533oEjlh7RmSlFNkNmktMVTr+KijujBUJ6sIjHSJaAqs66BLKHYy eUyl352yIznIzinjuqGnh5lWRw6+2Ig= X-Google-Smtp-Source: ABdhPJxpxAvtRng3W+AIrO4PtqG8FTZLNYmtss+XwxX5IOJk14hHvtAf2ltRNoNbvqNjW8TOtONEOw== X-Received: by 2002:aed:26e1:: with SMTP id q88mr12922911qtd.354.1595020570960; Fri, 17 Jul 2020 14:16:10 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 4/5] qemu_driver.c: modernize qemuConnectCPUModelComparison() Date: Fri, 17 Jul 2020 18:15:55 -0300 Message-Id: <20200717211556.1024748-5-danielhb413@gmail.com> In-Reply-To: <20200717211556.1024748-1-danielhb413@gmail.com> References: <20200717211556.1024748-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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use g_auto* on pointers to avoid using the 'cleanup' label. In theory the 'ret' variable can also be discarded if the flow of the logic is reworked. Perhaps another time. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d73d093465..393a7e27cb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13147,19 +13147,19 @@ qemuConnectCPUModelComparison(virQEMUCapsPtr qemu= Caps, virCPUDefPtr cpu_b, bool failIncompatible) { - qemuProcessQMPPtr proc =3D NULL; - char *result =3D NULL; + g_autoptr(qemuProcessQMP) proc =3D NULL; + g_autofree char *result =3D NULL; int ret =3D VIR_CPU_COMPARE_ERROR; =20 if (!(proc =3D qemuProcessQMPNew(virQEMUCapsGetBinary(qemuCaps), libDir, runUid, runGid, false))) - goto cleanup; + return VIR_CPU_COMPARE_ERROR; =20 if (qemuProcessQMPStart(proc) < 0) - goto cleanup; + return VIR_CPU_COMPARE_ERROR; =20 if (qemuMonitorGetCPUModelComparison(proc->mon, cpu_a, cpu_b, &result)= < 0) - goto cleanup; + return VIR_CPU_COMPARE_ERROR; =20 if (STREQ(result, "identical")) ret =3D VIR_CPU_COMPARE_IDENTICAL; @@ -13170,9 +13170,6 @@ qemuConnectCPUModelComparison(virQEMUCapsPtr qemuCa= ps, else ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; =20 - cleanup: - VIR_FREE(result); - qemuProcessQMPFree(proc); return ret; } =20 --=20 2.26.2 From nobody Thu May 2 05:33:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1595020759; cv=none; d=zohomail.com; s=zohoarc; b=BxHGpNRYH3s1JlF71Ix9OiP3RSl0dBMjSAdB5iJvft9oUswbPqmIuzNfQV2AHOfZedI2mjXipccYRd22YGBJl3AOe47PA0JQLi2qeK5UU8q2joim6MMnHicJ1xHYC76xgJGrZ/+wocDHqPyFy7SsfTNv+aP2ROBghksITkXJsgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595020759; 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=i9Q5SHc2UuA6cfp52VvaDzQAIkFVcot/suAKrTZOWk4=; b=X63rrusRNF/1febsZQ/e0wnng8bfn1ELmSyBetall9LxVuB6rYRwWgUraevroitW277/20b2WckyoxXdY6wGhG7fYbsE8yWOoWZyxdusDrPU2EnVlkWmm7W3rOWVA2bL8bkg0mf5GfLqgxUs8fPoGNnDskjvGf5frRa101CvIV4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595020759535763.2714942704151; Fri, 17 Jul 2020 14:19:19 -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-421-hWScp4bOOz6iFinsfJPA8w-1; Fri, 17 Jul 2020 17:19:15 -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 314F719067E4; Fri, 17 Jul 2020 21:19:10 +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 0F45217D75; Fri, 17 Jul 2020 21:19:10 +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 D1E9E1809557; Fri, 17 Jul 2020 21:19:09 +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 06HLGG5x019554 for ; Fri, 17 Jul 2020 17:16:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id E8C582166BA4; Fri, 17 Jul 2020 21:16:15 +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 E4B672166BA3 for ; Fri, 17 Jul 2020 21:16:15 +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 C03F81012443 for ; Fri, 17 Jul 2020 21:16:15 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-F8NGSJfRMKW92CYYRD2siA-1; Fri, 17 Jul 2020 17:16:13 -0400 Received: by mail-qk1-f196.google.com with SMTP id l6so10047132qkc.6 for ; Fri, 17 Jul 2020 14:16:13 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:9447:1f8b:580e:61d9:b1a4]) by smtp.gmail.com with ESMTPSA id x19sm11847162qtc.36.2020.07.17.14.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 14:16:12 -0700 (PDT) X-MC-Unique: hWScp4bOOz6iFinsfJPA8w-1 X-MC-Unique: F8NGSJfRMKW92CYYRD2siA-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=i9Q5SHc2UuA6cfp52VvaDzQAIkFVcot/suAKrTZOWk4=; b=Az6ZS+24HcX/7OITVHebI+x6cCWfmTh9pp4pouZ+KlEj7l06Anak/lf598AaRIbPXO fjX2H998R2NA7PB1vLSTjjixfD+Chss94BnO7PLkaLmCmRvSDQuqfSpvQrOOPZ+ZoiAl 1bI4VMLjN7EwEbmq183PbGG4W8z8xoVINsiKI83hbt+4wgu3nK24jekD03Yx7ZOOOy3B WoFOXGyp/YRlHx6LYT9OQkkA7Bg9wKBocDJYOEwD2xUsbiEi/R3v0nbRc69bCrN6TOK4 etedP7801XD273ZsnEFNkoiC+iGF96nvEaMgNyv/YvrYkhqAzJSIR0qn8BMFnPbNKw97 4s0Q== X-Gm-Message-State: AOAM53075jcUUExhTk0HxcwcYO8/3njxc26e+qi1vfO/e6nApPJGWTFy au9QTG9mHyOSXF6camzTe+V/HmceTH8= X-Google-Smtp-Source: ABdhPJzqrUx9u2S/wLB5WJRvEKxjUAqQ+rUwb9zOBDJTz7HXnSgEvpS5Nh3ad9HhV43QcANsDnVlZQ== X-Received: by 2002:a37:9ed6:: with SMTP id h205mr10636358qke.384.1595020572650; Fri, 17 Jul 2020 14:16:12 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 5/5] qemu_capabilities.c: use g_autoptr() in virQEMUCapsInitQMPSingle() Date: Fri, 17 Jul 2020 18:15:56 -0300 Message-Id: <20200717211556.1024748-6-danielhb413@gmail.com> In-Reply-To: <20200717211556.1024748-1-danielhb413@gmail.com> References: <20200717211556.1024748-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.14 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 Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 98ddd2dcdc..1a2cb874c0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5382,7 +5382,7 @@ virQEMUCapsInitQMPSingle(virQEMUCapsPtr qemuCaps, gid_t runGid, bool onlyTCG) { - qemuProcessQMPPtr proc =3D NULL; + g_autoptr(qemuProcessQMP) proc =3D NULL; int ret =3D -1; =20 if (!(proc =3D qemuProcessQMPNew(qemuCaps->binary, libDir, @@ -5401,7 +5401,6 @@ virQEMUCapsInitQMPSingle(virQEMUCapsPtr qemuCaps, if (ret < 0) virQEMUCapsLogProbeFailure(qemuCaps->binary); =20 - qemuProcessQMPFree(proc); return ret; } =20 --=20 2.26.2