From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373888; cv=none; d=zohomail.com; s=zohoarc; b=KdV2afUcu/Zj1IACINySwTLSlYG5KczCCpYBoldoc5PdHtl8fdcCPyMfltXbEdEe5t+EYyxMKbOFPma/Qs3xpx6jR74nem68mScXs6XX3RLu40UyosBKGhf/bmNeAYKmj8O1R3xZFWrKS+4puyNfPqO6/8v0fOUoFtEnCqRQ7s0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373888; 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=KpwCKPbwgemP9dWNBj179XNxhqIjpdrDL9jzzS4bGuc=; b=Ux+3iRQrDuS1Dagf8cGRvT4iEZMHbHcvaRQV383yZhyjt2aIsvzOAeZmgQ2zfKxgY5T5YtRrOh+Gn5BmFhE2HsbMf8HhAoZl4aBS6p7W/L9U5MWGw3q5Cp+HTFM3OQqX+Kkz13FLL+RUzlGwyIwJTGOcfZdTPPtVhwE01cZ/yMQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373888567596.9313661454088; Mon, 8 Nov 2021 04:18: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-22-eIg4-ey2PfK4l2aAAmH_FA-1; Mon, 08 Nov 2021 07:18:06 -0500 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 327A281C86C; Mon, 8 Nov 2021 12:18:01 +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 122A079446; Mon, 8 Nov 2021 12:18:01 +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 DA5EA1832DD6; Mon, 8 Nov 2021 12:18:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CHmhD011407 for ; Mon, 8 Nov 2021 07:17:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id CA99029676; Mon, 8 Nov 2021 12:17:48 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 139AB5D9DE; Mon, 8 Nov 2021 12:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373887; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=KpwCKPbwgemP9dWNBj179XNxhqIjpdrDL9jzzS4bGuc=; b=ag0HqcH7GUMkCTvSdz2DGCyckkNfjIUe1hTOFZ80bgEAHtRvsI1rnCRnCA/H1I1o1d8EvF 9yUei7Aw268LYKdcF45Ek5VtHUFwO1VB2QviyxQ09agVAsUDFu++ah9iWlvPGxb+94Fefj x628/MpsOVvWDjlXp71dA0EX4eD02po= X-MC-Unique: eIg4-ey2PfK4l2aAAmH_FA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/10] adminConnectListServers: Cleanup Date: Mon, 8 Nov 2021 13:17:31 +0100 Message-Id: <20211108121740.98621-2-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 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) X-ZM-MESSAGEID: 1636373889772100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/admin/admin_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c index 623c682b2d..6731a366cf 100644 --- a/src/admin/admin_server.c +++ b/src/admin/admin_server.c @@ -47,12 +47,12 @@ adminConnectListServers(virNetDaemon *dmn, virCheckFlags(0, -1); =20 if ((ret =3D virNetDaemonGetServers(dmn, &srvs)) < 0) - goto cleanup; + return ret; =20 if (servers) { *servers =3D g_steal_pointer(&srvs); } - cleanup: + if (ret > 0) virObjectListFreeCount(srvs, ret); return ret; --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1636373881; cv=none; d=zohomail.com; s=zohoarc; b=RIY64BCEdiEXpXJbMhTs9uVIf8690VxoQ/c2szgaOMVcGNNfAEgZUrVAchWZtSdPTN5knUuyfX/P89t0eB4odMitMcM7PyKDTvRsXqyQ5Zt6oi7/BaZZAEayKJa/QidI+d8mvwqXsyfPUr0+9eYi9gjZMBsizGOQq5ht7Qk19Ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373881; 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=TVZRCzNfQxe1ntigJfv+fTLifCz6wwTsa0Th3eNfwpc=; b=cLmzSmY7qFjOEKDtk7L787EAtXnwrA4xZgEGNuQ0ZIE8tIKgqXPNAB75y0L7MZvzwm4fZFTf8G2tiqSRZh9PWNxWx7ECL6IrA9d7f7XWwcpWzVPBtCmVwonygG0kGoR2Hk39jBOmRmdGoEbH6j+rmbb23TZYb2qxvB09ezXeIDs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163637388162656.45202711642355; Mon, 8 Nov 2021 04:18:01 -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-277-YlSUfVZOO8CGo3FSMjpgeQ-1; Mon, 08 Nov 2021 07:17:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 548701B18BC1; Mon, 8 Nov 2021 12:17:52 +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 D54B060C9F; Mon, 8 Nov 2021 12:17: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 7795D1819AC1; Mon, 8 Nov 2021 12:17:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CHnrA011417 for ; Mon, 8 Nov 2021 07:17:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id D4A415DA61; Mon, 8 Nov 2021 12:17:49 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 287E75DEFB; Mon, 8 Nov 2021 12:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373880; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=TVZRCzNfQxe1ntigJfv+fTLifCz6wwTsa0Th3eNfwpc=; b=f1MOQZgwsxftGtwD4on4vKfqBCDgY4l4XnJHvPz7BSWLAFuLQ153qNnfvM45K955uDiBda /NwYAaONeKtfc955TMvTaBfxgbJSo+TI0KUwnk+AKsdefiQ79j8523WyHTJmEjxiiTMKzd rMMzcbR+fLpOxpv2UJAjNd7Z+39WFV4= X-MC-Unique: YlSUfVZOO8CGo3FSMjpgeQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/10] virCHDomainObjBeginJob: Cleanup Date: Mon, 8 Nov 2021 13:17:32 +0100 Message-Id: <20211108121740.98621-3-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 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) X-ZM-MESSAGEID: 1636373882466100003 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/ch/ch_domain.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 9d32d8669a..dd4de9e1ea 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -87,8 +87,22 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDoma= inJob job) while (priv->job.active) { VIR_DEBUG("Wait normal job condition for starting job: %s", virCHDomainJobTypeToString(job)); - if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0) - goto error; + if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0= ) { + VIR_WARN("Cannot start job (%s) for domain %s;" + " current job is (%s) owned by (%d)", + virCHDomainJobTypeToString(job), + obj->def->name, + virCHDomainJobTypeToString(priv->job.active), + priv->job.owner); + + if (errno =3D=3D ETIMEDOUT) + virReportError(VIR_ERR_OPERATION_TIMEOUT, + "%s", _("cannot acquire state change lock")= ); + else + virReportSystemError(errno, + "%s", _("cannot acquire job mutex")); + return -1; + } } =20 virCHDomainObjResetJob(priv); @@ -98,22 +112,6 @@ virCHDomainObjBeginJob(virDomainObj *obj, enum virCHDom= ainJob job) priv->job.owner =3D virThreadSelfID(); =20 return 0; - - error: - VIR_WARN("Cannot start job (%s) for domain %s;" - " current job is (%s) owned by (%d)", - virCHDomainJobTypeToString(job), - obj->def->name, - virCHDomainJobTypeToString(priv->job.active), - priv->job.owner); - - if (errno =3D=3D ETIMEDOUT) - virReportError(VIR_ERR_OPERATION_TIMEOUT, - "%s", _("cannot acquire state change lock")); - else - virReportSystemError(errno, - "%s", _("cannot acquire job mutex")); - return -1; } =20 /* --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1636373894; cv=none; d=zohomail.com; s=zohoarc; b=e8jElo7lh8mAvaHjNl6RnvJXyTB05gIcoUfE7/WcaSpuqFHudFpLab/ocaqB2vvZ2DeZnHcn18mbq1KiU59Jxz60JYaN7mjAShkJ9W44N8IlQB3RuEA12zA5M0aQEtBYt0LF5dMwq0YzTn5NFfWlYTawRAVAmMAXWtnw9foMt98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373894; 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=oewY8hJNzdzgrToAXXgOCCCidkkm8yYNYyvvD8Z+SOg=; b=bB3F0rho05iBBBQLLo9W8p/Ugg0PXX0fAhk1PIeXwR6h6xsdp9rxdO3eCLp0YeccTuv5/EsqN+AetjdtEwpNhxkIZk3S7rueZ9Rjolxc2XqqpJ8zm1tZo0IYmOFtJeuCHpA07Wy/v/hCO91ey5h2Wq4oMwbX1mljy8tJ1X45CZw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163637389475465.80973513885829; Mon, 8 Nov 2021 04:18:14 -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-15-3hK6nALoObiN_OzouXnLSw-1; Mon, 08 Nov 2021 07:18:10 -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 EAEF8A40C3; Mon, 8 Nov 2021 12:18: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 C79B856A89; Mon, 8 Nov 2021 12:18:03 +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 979DE4E58F; Mon, 8 Nov 2021 12:18:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CHoxZ011422 for ; Mon, 8 Nov 2021 07:17:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id E5EB65DA61; Mon, 8 Nov 2021 12:17:50 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37F415DEFB; Mon, 8 Nov 2021 12:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=oewY8hJNzdzgrToAXXgOCCCidkkm8yYNYyvvD8Z+SOg=; b=MN1jnbUWhh2uMSUFFONGXpgDTUDgHeMit3Vi6TNPyi0eh80C5URT+GI0YOBTf1eo3DvxQy Et+8GnjQFIyj/OaSiKGcXsMMpd7HiKOutOmGOgnlTWWqBdPDF0DmDxha5KMpy24T3NBKXA 3R1op0n7zH6PNTuH32hwnPr4ZR1Z8JY= X-MC-Unique: 3hK6nALoObiN_OzouXnLSw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/10] virDomainCapsCPUModelsCopy: Cleanup Date: Mon, 8 Nov 2021 13:17:33 +0100 Message-Id: <20211108121740.98621-4-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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) X-ZM-MESSAGEID: 1636373896933100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_capabilities.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 22f0963326..1766129092 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -157,7 +157,7 @@ virDomainCapsCPUModelsNew(size_t nmodels) virDomainCapsCPUModels * virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *old) { - virDomainCapsCPUModels *cpuModels; + g_autoptr(virDomainCapsCPUModels) cpuModels =3D NULL; size_t i; =20 if (!(cpuModels =3D virDomainCapsCPUModelsNew(old->nmodels))) @@ -169,14 +169,10 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *ol= d) old->models[i].usable, old->models[i].blockers, old->models[i].deprecated) < 0) - goto error; + return NULL; } =20 - return cpuModels; - - error: - virObjectUnref(cpuModels); - return NULL; + return g_steal_pointer(&cpuModels); } =20 =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373898; cv=none; d=zohomail.com; s=zohoarc; b=Xh+HWqbSK5mK4zrwoAwT6643xx6sCw9ZwWZHXlF/D5AiaUb/p7bPn4upRG9W1XhIx72iacDP02SX50PO5+tkJZZ23Hm2ZgPpJx/OApUejvoLmomo49oCBBSaFfxAMvRezlMz8XVOaUn5j5jO007kGIoWGRH+l4Za9MvN3Vh8d3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373898; 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=ElQwrLYg1TV/4A5DpvAcBC/PfoUmQ0km+bBvQ+EfHJM=; b=FXgG5oabCgJ3PuxMur7tJrEnLGqiCjBO3Wecsz+HJtFgSnzqlPt3hPXy91ZOpwY/d/kpDHS4dYIiorTgmybhAQKDGlfn3KPCm2MCQuDiPxlZxHE3us5aV+vDgVCFrMszVLyz7VeMhzGY1rRpWjlimOjMEX8VKmIxUbHrURMcvW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373898867179.84594602625452; Mon, 8 Nov 2021 04:18:18 -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-490-c6DfcfNAOh2-JNB18fcfkg-1; Mon, 08 Nov 2021 07:18:14 -0500 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 46A958799EF; Mon, 8 Nov 2021 12:18:07 +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 D6C46101E59B; Mon, 8 Nov 2021 12:18:06 +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 9CB004EA29; Mon, 8 Nov 2021 12:18:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CHuex011457 for ; Mon, 8 Nov 2021 07:17:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 818395E274; Mon, 8 Nov 2021 12:17:56 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2F929676; Mon, 8 Nov 2021 12:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373897; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ElQwrLYg1TV/4A5DpvAcBC/PfoUmQ0km+bBvQ+EfHJM=; b=ZOSTn2H+ODYqvkAPOosWh+GQbwSENhqIqkNNjMkdD21iDK5qfEWf9TQW3yvyHxu6xJMTsb dGLOUZQyyX9peycinLaBMDkcpaxRdAV18x6BYHpZRhfXg1PQXOd+lzCODU6m/Szw3y1L9I knpsqhyYcOlwdX0yEi+2MaZCqfOy+fE= X-MC-Unique: c6DfcfNAOh2-JNB18fcfkg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/10] virNetworkEventDispatchDefaultFunc: Cleanup Date: Mon, 8 Nov 2021 13:17:34 +0100 Message-Id: <20211108121740.98621-5-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 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) X-ZM-MESSAGEID: 1636373900272100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/network_event.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/conf/network_event.c b/src/conf/network_event.c index a47bf4dd3e..6335cbf711 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -86,8 +86,8 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, virConnectObjectEventGenericCallback cb, void *cbopaque) { - virNetworkPtr net =3D virGetNetwork(conn, event->meta.name, event->met= a.uuid); - if (!net) + g_autoptr(virNetwork) net =3D NULL; + if (!(net =3D virGetNetwork(conn, event->meta.name, event->meta.uuid))) return; =20 switch ((virNetworkEventID)event->eventID) { @@ -100,16 +100,13 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, networkLifecycle= Event->type, networkLifecycle= Event->detail, cbopaque); - goto cleanup; + return; } =20 case VIR_NETWORK_EVENT_ID_LAST: break; } VIR_WARN("Unexpected event ID %d", event->eventID); - - cleanup: - virObjectUnref(net); } =20 =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373918; cv=none; d=zohomail.com; s=zohoarc; b=mWSRWqZjNL032oSzTfeNVVLRToDaSRRikzP07PQdTsUyr3vVENT5Ya6unDwoRpVBGlHrX4n7uYinFuzXXZlCnj38n75HlOSbGydY4kzfaQ7f3W7lf7pSolcxzIuEZ8FQoJEiQQ8LV9e+eZAFKULwleGusySKNwRKT16jE7EH4Oo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373918; 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=xIQ796R2vsSQ/Ek4+SKoH+Z5mqe7TNZMWW1Uo2Oc/rw=; b=OCGajhLC4ZPOk6C7tjjU802CEeWXLqQvLM9qu7LUevzwCZ2Ij9QWghuphm4uMXdbkYyTdoixFY8S192V1mF1CpMlVX01vvJTWpTLzWuwk3LGpYJTj8QPLSMkqB0cL0RvGIT3A6siVJSJDqvj8hEtvPnYWkGEfPIyELYMQcIpmrg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373918495811.9557179371787; Mon, 8 Nov 2021 04:18:38 -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-34-PMxW3iWjNAuOJeas5aCxww-1; Mon, 08 Nov 2021 07:18:34 -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 3DF188799F3; Mon, 8 Nov 2021 12:18:29 +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 1B8A256A86; Mon, 8 Nov 2021 12:18:29 +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 537FE4EA30; Mon, 8 Nov 2021 12:18:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CIRLw011769 for ; Mon, 8 Nov 2021 07:18:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5E33C1816A; Mon, 8 Nov 2021 12:18:27 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D5DC5DF5D; Mon, 8 Nov 2021 12:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373917; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=xIQ796R2vsSQ/Ek4+SKoH+Z5mqe7TNZMWW1Uo2Oc/rw=; b=RtakqxkF/DJzXqfouPGqcU9/+JJKriGrfvtfctlV+Ol4z63SjBmZEWL1hwOZs4FJBtMJme omX2xW3BJs9JhbNcMAIbSnVaLi7S/kOhvwMSIhejBl7KC+yYxacD2A7FxFFYjusJrf2zx/ a21n4pwTIq0CUTs2Wx9w/Xe9pxQzTgw= X-MC-Unique: PMxW3iWjNAuOJeas5aCxww-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/10] virSaveCookieParse: Cleanup Date: Mon, 8 Nov 2021 13:17:35 +0100 Message-Id: <20211108121740.98621-6-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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) X-ZM-MESSAGEID: 1636373920021100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/virsavecookie.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/conf/virsavecookie.c b/src/conf/virsavecookie.c index 6cb7fafb1f..c24a292355 100644 --- a/src/conf/virsavecookie.c +++ b/src/conf/virsavecookie.c @@ -58,19 +58,14 @@ virSaveCookieParse(xmlXPathContextPtr ctxt, virSaveCookieCallbacks *saveCookie) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - int ret =3D -1; =20 *obj =3D NULL; =20 if (!(ctxt->node =3D virXPathNode("./cookie", ctxt))) { - ret =3D 0; - goto cleanup; + return 0; } =20 - ret =3D virSaveCookieParseNode(ctxt, obj, saveCookie); - - cleanup: - return ret; + return virSaveCookieParseNode(ctxt, obj, saveCookie); } =20 =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373938; cv=none; d=zohomail.com; s=zohoarc; b=mXbUi+KGBxV1HFXa7PSYlNi47NVWOvCg9auTSQjkXDx3fndx8l/bbqtL317TtSgZCI0rOF6Ab8b3f0pVpiOEFADg8aMm/yBABko2KosmYaQJxN2AxmABxDxGRSZPodiSYuSIF7ed7g7hINL2z/fLtZOYx+7pwG70brxhEbGYizA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373938; 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=/FSqb5knTTLszIQz5KNv6i6mcUDgn804DULKOtPe20E=; b=l9kYKBYNkpFdxfPrDJlXbeSkKwveNMQ59bQz97GE2UwdDQGWEzAvIFAMBUFx6jwUmGlrkDO7XiEYxnX7gpRhJdRnkWNbq3TNdfQB354WF8Dp1dssVhmwdHm7JUUvgHvQkYmCSa2ri+ThX1CJ3g8vqxRyJP1pmz8usXEG3Ln5z0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373938139913.3732099402619; Mon, 8 Nov 2021 04:18:58 -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-100-Qu8bmWD-P12Wds2jG87ieg-1; Mon, 08 Nov 2021 07:18:55 -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 804BE1030C20; Mon, 8 Nov 2021 12:18:50 +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 5474C62A41; Mon, 8 Nov 2021 12:18:50 +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 1F8E64EA30; Mon, 8 Nov 2021 12:18:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CInvb011842 for ; Mon, 8 Nov 2021 07:18:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id B72D41816A; Mon, 8 Nov 2021 12:18:49 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0909D5DA61; Mon, 8 Nov 2021 12:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373937; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=/FSqb5knTTLszIQz5KNv6i6mcUDgn804DULKOtPe20E=; b=h5gEzHe3KRsZ7jsr0NHqfIxF/H3pseFffx8xerPbPQW3+zdasj8gglR5gdo5HY8Fc/bGim MHhK6wDds89k8NM2MQahj/RMEHJFKEmR0zXi9Va/wc5HFbOOF2fcFLC2+3yZeG1WN3DSUZ QkENyFrubQHeblWfq6F1GZpziZpfuUU= X-MC-Unique: Qu8bmWD-P12Wds2jG87ieg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/10] virBufferAddBuffer: Cleanup Date: Mon, 8 Nov 2021 13:17:36 +0100 Message-Id: <20211108121740.98621-7-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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) X-ZM-MESSAGEID: 1636373939736100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/util/virbuffer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 8f9cd57e06..a4834174a1 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -185,13 +185,11 @@ virBufferAddBuffer(virBuffer *buf, virBuffer *toadd) if (!toadd || !toadd->str) return; =20 - if (!buf) - goto cleanup; - - virBufferInitialize(buf); - g_string_append_len(buf->str, toadd->str->str, toadd->str->len); + if (buf) { + virBufferInitialize(buf); + g_string_append_len(buf->str, toadd->str->str, toadd->str->len); + } =20 - cleanup: virBufferFreeAndReset(toadd); } =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373941; cv=none; d=zohomail.com; s=zohoarc; b=BclMUEMR+UMvevzorx90jIcl7REhFsqn/l8TPuadjexjP3jowwclQ4h+biV5mP+L1uSKxOZyBQzd429Lb/DM5unRRIfTnMyw29ouKxp/ATnDQZwIIjKXNbdEWsad5GD6cKzQImkZAJZZja89yrX1eLpdJftqwLlcwKcvZea2GLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373941; 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=T2MA581d/YB4ZLUDi1H7BclZ7GGSuUSlIWkr0bHdIg0=; b=Pb4x5scpPKIJjDodSW08qrntmfLvlWjGVL7C0vY2UkEoLHxuJpK0ZMi1j9GCzfpWCj+W3jSunUfcoxGSpODcQu7+Rnl2BmSv9z1sbWlQiAv5JoSfNVJclrCt5VJ8RXbjwfqymsu28dyFV+fx6r+loaTwMpEnbBOl+BdpmF00ySQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373941182891.508445782701; Mon, 8 Nov 2021 04:19:01 -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-440-QbxGjiNFOcW5ZxhHrc8LEQ-1; Mon, 08 Nov 2021 07:18:56 -0500 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 3A3C2824F87; Mon, 8 Nov 2021 12:18:52 +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 19D344180; Mon, 8 Nov 2021 12:18:52 +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 9A0161832DD9; Mon, 8 Nov 2021 12:18:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CIoO5011864 for ; Mon, 8 Nov 2021 07:18:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id C25201816A; Mon, 8 Nov 2021 12:18:50 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 179CC5DF5D; Mon, 8 Nov 2021 12:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373940; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=T2MA581d/YB4ZLUDi1H7BclZ7GGSuUSlIWkr0bHdIg0=; b=LZnag+fPefkAPuxuDlFknyQN/UqeozWyMr3zxfYXX/6dbGxQhRm3VFT1g/KpqdvTN/KQmQ w0dw6mfwuQafMZAjz3HYfR52efDV+S15Zv/JzwsPE6NXXs2Gar9C85ciLTkN/+YCYcx+FV A8KMvozdCFhShhY2YZfcqmuwlZ04P8g= X-MC-Unique: QbxGjiNFOcW5ZxhHrc8LEQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] virSCSIVHostOpenVhostSCSI: Cleanup Date: Mon, 8 Nov 2021 13:17:37 +0100 Message-Id: <20211108121740.98621-8-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 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) X-ZM-MESSAGEID: 1636373942124100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label, goto, and closing of not-open file descriptor. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/util/virscsivhost.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index afbfddb0fb..487301ab64 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -90,15 +90,10 @@ virSCSIVHostOpenVhostSCSI(int *vhostfd) =20 if (*vhostfd < 0) { virReportSystemError(errno, _("Failed to open %s"), VHOST_SCSI_DEV= ICE); - goto error; + return -1; } =20 return 0; - - error: - VIR_FORCE_CLOSE(*vhostfd); - - return -1; } =20 =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636373942; cv=none; d=zohomail.com; s=zohoarc; b=IrWtcswTG/AvHihwUbuCUPYj0z7nly4l7Ji903ACXJbuDCAQbVc4LhyIvusBpWDQGLS1519d/rWHGGlQ6v3+tuHWjG+UBJzGTp9e6Avg0tyNGG0ZI6H67Jo49MXNorFAcwhDS0NjHoMH6xyBrx/Rn1XlkVL+aKIX+6tp7iN6RT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373942; 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=rfQnkWrtQrs/Y9P3r1buvMRRjJfcWhXweS39sCDFDi0=; b=kLHzDtdTnPnhsBYRpQ9r/ZcTfPL7l4dgi5CKBu0p/nfbkbn+BV/4klbsehDi8z8MpnD2bVCMklgGIkINBhsv4hKxukEwL34hB35LnavAGKQmy0D5/QGi7lmdmAT+nRnaxAeZQJCL5QCdKVnOJHF1pTemuT2cm+4MkyW6gFy8Vjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636373942763676.4906414763769; Mon, 8 Nov 2021 04:19:02 -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-478-mOILwDuIMeis3ecL0wUGrg-1; Mon, 08 Nov 2021 07:19:00 -0500 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 593C1A40C1; Mon, 8 Nov 2021 12:18:55 +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 11D734180; Mon, 8 Nov 2021 12:18:55 +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 D51A64EA37; Mon, 8 Nov 2021 12:18:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CIp25011876 for ; Mon, 8 Nov 2021 07:18:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id CE13D1816A; Mon, 8 Nov 2021 12:18:51 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 208335DEFB; Mon, 8 Nov 2021 12:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373941; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=rfQnkWrtQrs/Y9P3r1buvMRRjJfcWhXweS39sCDFDi0=; b=e4xzOa1Kt+Lcy4DbONTyXv8aRvvtd9lKabLWVJnSOXITdOYJmgUS+Dfufvx/kTeeDhDynV 2CMFynWy2rjZsFZW3IwWhW1lOWWxi4n9SWvAGpNjSZ8vlD2hX5vqJUI6dkJaILYgeLNW1k K1GRlBYgOxOqSrHjEzJc4f69laZsq90= X-MC-Unique: mOILwDuIMeis3ecL0wUGrg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/10] fillXenCaps: Cleanup Date: Mon, 8 Nov 2021 13:17:38 +0100 Message-Id: <20211108121740.98621-9-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 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) X-ZM-MESSAGEID: 1636373944207100003 Content-Type: text/plain; charset="utf-8" Rework to remove unnecessary label and goto. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- tests/domaincapstest.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 9ea5bed5c2..4a46acb9ad 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -135,25 +135,17 @@ fillQemuCaps(virDomainCaps *domCaps, static int fillXenCaps(virDomainCaps *domCaps) { - virFirmware **firmwares; - int ret =3D -1; - - firmwares =3D g_new0(virFirmware *, 2); - - firmwares[0] =3D g_new0(virFirmware, 1); - firmwares[1] =3D g_new0(virFirmware, 1); + g_autoptr(virFirmware) fw_hvmloader =3D g_new0(virFirmware, 1); + g_autoptr(virFirmware) fw_ovmf =3D g_new0(virFirmware, 1); + virFirmware *firmwares[] =3D { fw_hvmloader, fw_ovmf }; =20 firmwares[0]->name =3D g_strdup("/usr/lib/xen/boot/hvmloader"); firmwares[1]->name =3D g_strdup("/usr/lib/xen/boot/ovmf.bin"); =20 if (libxlMakeDomainCapabilities(domCaps, firmwares, 2) < 0) - goto cleanup; - - ret =3D 0; + return -1; =20 - cleanup: - virFirmwareFreeList(firmwares, 2); - return ret; + return 0; } #endif /* WITH_LIBXL */ =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1636373948; cv=none; d=zohomail.com; s=zohoarc; b=R1bZ3+t+NzbRLgewNbfaZdCZVJhwsSdHpIi/Qwo1XL0GldjHt2D63Dnubz0NAiSs53S3VrssYFOG3LX0qygmgT/ZoD2Mur6atpEK1nI/DKs/3XtWBGbqs16Xx7vXMjYQ7d61lQkgOJpKYxNLPG5f+P2ds72HoNmwQVUjATaOXEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373948; 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=LNmpVOA10OOWXzrBQfp+WOV0D0/phP+zf9on6639YPk=; b=nthQw3siy6ec9D4KekFt85twwbYM/9sNxl7C4Fa6GERxXTWExXcW8dt36SUKHrjnbevoH5eDvBwEARQCwxnRs0Mh2Uyefi6/DltgU/pGFo7RpOX+Gd28r5Kj1GKo7jRx+QDQKmAylkOy/+IgRaQ3Z0bQtZr+L9mvHOsGREJJPnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1636373948121439.86765816915965; Mon, 8 Nov 2021 04:19: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-349-P7WNxdNTNmi3bRCt6pxHEw-1; Mon, 08 Nov 2021 07:19:03 -0500 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 5317B8799EC; Mon, 8 Nov 2021 12:18:58 +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 2D4C719C79; Mon, 8 Nov 2021 12:18:58 +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 F3D181832DF3; Mon, 8 Nov 2021 12:18:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CIqlr011899 for ; Mon, 8 Nov 2021 07:18:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id E025829676; Mon, 8 Nov 2021 12:18:52 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CA265DA61; Mon, 8 Nov 2021 12:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373946; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=LNmpVOA10OOWXzrBQfp+WOV0D0/phP+zf9on6639YPk=; b=Hx2YQBsRaijDUqzU5xD4322nf2oJlBajHuTLErrdpyqpOnhPsZ6ZVdy++2IAI6S+08FoSu HAhv4Iyo+3ACc54BUVTXZVhKNmMF9qJpXlpMWmmcuNekJwcs0u9lt4uX9NPCaTxx2kiArQ rIRBmxogJ4gLldIluItFHTo1i5K2+uA= X-MC-Unique: P7WNxdNTNmi3bRCt6pxHEw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/10] testLXCCapsInit: Cleanup Date: Mon, 8 Nov 2021 13:17:39 +0100 Message-Id: <20211108121740.98621-10-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 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) X-ZM-MESSAGEID: 1636373948990100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Cleanup line breaks. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- tests/testutilslxc.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c index 857407dfb2..ac7a01a4e8 100644 --- a/tests/testutilslxc.c +++ b/tests/testutilslxc.c @@ -11,11 +11,10 @@ virCaps * testLXCCapsInit(void) { - virCaps *caps; + g_autoptr(virCaps) caps =3D NULL; virCapsGuest *guest; =20 - if ((caps =3D virCapabilitiesNew(VIR_ARCH_X86_64, - false, false)) =3D=3D NULL) + if ((caps =3D virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) =3D= =3D NULL) return NULL; =20 guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE, @@ -33,20 +32,14 @@ testLXCCapsInit(void) virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, = 0, NULL); =20 if (virTestGetDebug()) { - g_autofree char *caps_str =3D NULL; - - caps_str =3D virCapabilitiesFormatXML(caps); + g_autofree char *caps_str =3D virCapabilitiesFormatXML(caps); if (!caps_str) - goto error; + return NULL; =20 VIR_TEST_DEBUG("LXC driver capabilities:\n%s", caps_str); } =20 - return caps; - - error: - virObjectUnref(caps); - return NULL; + return g_steal_pointer(&caps); } =20 =20 --=20 2.31.1 From nobody Sun May 5 09:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1636373948; cv=none; d=zohomail.com; s=zohoarc; b=TrDwaJbBvYQqR6Bjg17MqU+XYiPKE6oe5S8F8Nk6AH1MXOucfelhKQH5od2+HtGf6OaZKbWWFgu2FuXaIryPHkhxpAv4+hNZg45gv12Hwyx/e33DPXvF5OgiLyX0x7L4Wyd8YquF2UkIh1ub0F+CjLjug8SdAVtxqfm6E8JuLgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373948; 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=TQR3Bz7XKNqnLtVQq9yRS7txHHW4580+G8CQqS5Ts7Q=; b=WL6laKBgWuHtAG7KqsrwBZyw1lRq8foM05XrcpEGxghGiX4fb3LXxG8wg14ywnnpkPl+nSaWtV/C37H0lKwe7wrbzPBvB+DNRyTNIDzEUZw9jYCE6shJowGcbqdieqkCNhAYBQj261I29Cmszn0Ttk0ujm3OFZjIReH09vx1Jps= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1636373948350782.4990033191161; Mon, 8 Nov 2021 04:19: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-401-uXhJ4_ToOa-5S91XjNhCaQ-1; Mon, 08 Nov 2021 07:19:03 -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 03713A40C3; Mon, 8 Nov 2021 12:18:56 +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 D3F4C5F4F4; Mon, 8 Nov 2021 12:18:55 +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 A707A1832DDE; Mon, 8 Nov 2021 12:18:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A8CIsvM011909 for ; Mon, 8 Nov 2021 07:18:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D3105DA61; Mon, 8 Nov 2021 12:18:54 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62B0E5DF5E; Mon, 8 Nov 2021 12:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373947; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=TQR3Bz7XKNqnLtVQq9yRS7txHHW4580+G8CQqS5Ts7Q=; b=i911Jzdwr5Hc7BraPjZqbmqH82zpWWgTmQUtCiSVFJGH9Ep76ZIkei0ZfXTeagm3UdmHrj LFLe/A5URvVAO1sLZChPW1pFCg/fdXoAnk5lPpzindSO++BXFep9awx+Fs83wC1Avaw1cH CbjWRvxJIEGiCINTvd1awat6Dxoeq8Y= X-MC-Unique: uXhJ4_ToOa-5S91XjNhCaQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/10] testVshTableHeader: Cleanup Date: Mon, 8 Nov 2021 13:17:40 +0100 Message-Id: <20211108121740.98621-11-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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) X-ZM-MESSAGEID: 1636373949116100002 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. This also fixes a bug where a failure to create the table would result in the test passing. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- tests/vshtabletest.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 716b11dbc0..41ceec0a51 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -45,7 +45,8 @@ static int testVshTableHeader(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; - char *act =3D NULL; + g_autofree char *act =3D NULL; + g_autofree char *act2 =3D NULL; const char *exp =3D " 1 fedora28 running\n" " 2 rhel7.5 running\n"; @@ -58,7 +59,7 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED) g_autoptr(vshTable) table =3D vshTableNew("Id", "Name", "State", NULL); //to ask about return if (!table) - goto cleanup; + return -1; =20 vshTableRowAppend(table, "1", "fedora28", "running", NULL); vshTableRowAppend(table, "2", "rhel7.5", "running", @@ -68,13 +69,10 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED) if (virTestCompareToString(exp, act) < 0) ret =3D -1; =20 - VIR_FREE(act); - act =3D vshTablePrintToString(table, true); - if (virTestCompareToString(exp2, act) < 0) + act2 =3D vshTablePrintToString(table, true); + if (virTestCompareToString(exp2, act2) < 0) ret =3D -1; =20 - cleanup: - VIR_FREE(act); return ret; } =20 --=20 2.31.1