From nobody Thu May 2 13:06:40 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=1625575142; cv=none; d=zohomail.com; s=zohoarc; b=bVzRCLFiYfRaFJpcQ7CTd2cnxrrHVxoisw1g23wOdbayoNm1b2B6c64VsxHyTkrUEken/WC9VLa0BFMpCHsuml4uUs04iwfqPHApNL26N9geYTYbkMSUrNJk8ZzCkJhY7IoYHI7pvyJy04ClfRfLczkfo3jPqw3M1Z6LCCB+uw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575142; 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=RdgqOhN1VbMO//o6af/WNhDK3creY/FR7rXM1wq8HQw=; b=iqtJtRoIe9+/QKs3BpwRFhVcye0ahnWpE3Z0TsI5fwUYSoWm9+HwxthoVZ0vAUiPPRqrFzlyrdDt2BJmuQJGL/vxQHoV5I3d9Wwr1S3IEi/4rqbBFnC8wH1IBC+xTSLlMJasLC9kfA1vpZcD8rK5x9NCkXkNMU78W8LM/vickNk= 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 1625575142478758.2439862565813; Tue, 6 Jul 2021 05:39:02 -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-420-UIZSskSCP6q7jNLFgJwLEA-1; Tue, 06 Jul 2021 08:38:52 -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 0E4221923784; Tue, 6 Jul 2021 12:38:35 +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 8C877798D2; Tue, 6 Jul 2021 12:38:34 +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 1D5F31809C99; Tue, 6 Jul 2021 12:38:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CcWx5001972 for ; Tue, 6 Jul 2021 08:38:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id A00B7772FD; Tue, 6 Jul 2021 12:38:32 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 691F478308; Tue, 6 Jul 2021 12:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575136; 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=RdgqOhN1VbMO//o6af/WNhDK3creY/FR7rXM1wq8HQw=; b=fqRdgWcSGyy2LPcNfuVpV4T0vFA2kmLPfZzyjcrMHY8evJ+AF+Pi309EM2vdYH3C2/5YWH z1CMf+114YLVDTIqI0rIf35QxEQTKQoZcl6sCcWhfBaBHL1gu1TTme37HyLBDD3BDZuV/5 i8Jb87CrnBP5Dfg9hcq5IO3cE8bVbcA= X-MC-Unique: UIZSskSCP6q7jNLFgJwLEA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 01/11] qemuMonitorGetAllBlockStatsInfo: Clean up line break Date: Tue, 6 Jul 2021 14:37:49 +0200 Message-Id: <20210706123759.312072-2-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 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: 1625575144684100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8f35b4240f..df1e41f68f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2162,8 +2162,7 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, if (!(*ret_stats =3D virHashNew(g_free))) goto error; =20 - ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, *ret_stats, - backingChain); + ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, *ret_stats, backingCh= ain); =20 if (ret < 0) goto error; --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575147; cv=none; d=zohomail.com; s=zohoarc; b=NeGfd9qRT+wV2RN5Y/e/oaUaf2Ht9uNGIGc8xTkhTeNTFel11UFJKy6lujszzuXz4F9ndH4TW5NDX5eskELjjrTZdVgjJ96upvIBmb76zkg7G2SGedSfBuaC5PC8M3lfG7Ee1n7JUfEvhAM1Kvgg7MGUzaDP99OyVBGayTXoLo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575147; 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=rPttV5cbrkzRAZxzSLN8DY0p0JWyVtjBAuOGZ5vgBcQ=; b=iHMPESOqsQuTuGMzmNkBRDy4rG/epT3aRIhGhLNEtbX7KN4SDjB5gO6q0n+E0euyylFa3yCvv5oyk48Ky2NoUu3b+LlUKWiW/wDILfR8UbDjdNA1+Ing8b3fo98u7k3W1UsUMooZclsfcPWBd2Q9Q1BMDjWXnUd9G6Dtha1iwF4= 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 1625575147611970.4537037201399; Tue, 6 Jul 2021 05:39:07 -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-337-rZFr2I6POKqKbrDGVF0b-w-1; Tue, 06 Jul 2021 08:39:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79C3DC73A0; Tue, 6 Jul 2021 12:38:42 +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 52A201000324; Tue, 6 Jul 2021 12:38:42 +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 18A464EA2A; Tue, 6 Jul 2021 12:38:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166Ccehk002005 for ; Tue, 6 Jul 2021 08:38:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id E482A5D6A1; Tue, 6 Jul 2021 12:38:40 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30EA27832E; Tue, 6 Jul 2021 12:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575146; 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=rPttV5cbrkzRAZxzSLN8DY0p0JWyVtjBAuOGZ5vgBcQ=; b=iiEMYaM+J3SFEQbMa/GeRE4ppNVtMBxvkDF8diJC3eeVjqjtWBZvkpg1dAe8LVcPDFu8he kG2FNF4z/oOP3el+NjQaZ814nWMArl7mIDIFiNpWUjQrp6ksFV6N3XILO3meplRRpPSZXk Ui8hIwjwdCcFvbtNS0Oa13LrAgXnhmI= X-MC-Unique: rZFr2I6POKqKbrDGVF0b-w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 02/11] qemuMonitorGetAllBlockStatsInfo: Remove superfluous variable initialization Date: Tue, 6 Jul 2021 14:37:50 +0200 Message-Id: <20210706123759.312072-3-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575158637100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index df1e41f68f..19fcc5658b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2154,7 +2154,7 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable **ret_stats, bool backingChain) { - int ret =3D -1; + int ret; VIR_DEBUG("ret_stats=3D%p, backing=3D%d", ret_stats, backingChain); =20 QEMU_CHECK_MONITOR(mon); --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575149; cv=none; d=zohomail.com; s=zohoarc; b=RoJQ3mL66wx2J5es8X/GvtlKDBDMcw/2/bAQflYtQnUd57JV1VBMCJ+YqAONhmknyW1WJqjVrFQLziV7/vcvL4mLI/in5dXMW7U99bK3tH783F/n1vTincu1V7UPkmqWuC3+CrCBV2EJWa80isSYgn9bDPq7Q+AaVYAdVzjZKNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575149; 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=Ja/LXHxNUK+0XjYMsQJefWJAJzT3/Od2d0ChSdu39E4=; b=BoKnCRP0fO75dkuG12blI+XXeAkLglQkj/PJPu82k4joP5xkw2lWt+ThNVD/HOqZ+tflY0wdNkSIBe2Z1J8HprnlwinvBeJfF+vrpm783DMwRd0GIxqs2sY2IzVxLpObnmx36VHbvw7jizCXBjiGDSbO2At/aZkFZC6IV0NCqcc= 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 1625575149523270.9082948799064; Tue, 6 Jul 2021 05:39:09 -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-400-JsPXDYrUNhePHrcFF2qPWg-1; Tue, 06 Jul 2021 08:39:06 -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 B6E021017960; Tue, 6 Jul 2021 12:38:44 +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 3E19EA2942; Tue, 6 Jul 2021 12:38:44 +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 008CC4EA2F; Tue, 6 Jul 2021 12:38:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CchaC002018 for ; Tue, 6 Jul 2021 08:38:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7740678C1C; Tue, 6 Jul 2021 12:38:42 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 441985D6A1; Tue, 6 Jul 2021 12:38:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575148; 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=Ja/LXHxNUK+0XjYMsQJefWJAJzT3/Od2d0ChSdu39E4=; b=LG0Rw3G9dbT3B5/95k2QWurbY1m4OmBcWUgexj1+d+eJ5DbOfedGcAKp3mt2054AfRs+7u eWw/1oNpmNk0yZoISO4DoR4vFms/LgclNM7eWwxhabrD9I0VYpAShOwghLgwVC5v+wjXPx XjnBuPonBtb68GD05IRqYDuZNbt/rs0= X-MC-Unique: JsPXDYrUNhePHrcFF2qPWg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 03/11] qemuMonitorGetAllBlockStatsInfo: Assign hash table only on success Date: Tue, 6 Jul 2021 14:37:51 +0200 Message-Id: <20210706123759.312072-4-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 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: 1625575151714100003 Content-Type: text/plain; charset="utf-8" `virHashNew` cannot return NULL, the check is not needed. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 19fcc5658b..d24531832b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2155,22 +2155,24 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, bool backingChain) { int ret; + GHashTable *stats =3D NULL; VIR_DEBUG("ret_stats=3D%p, backing=3D%d", ret_stats, backingChain); =20 QEMU_CHECK_MONITOR(mon); =20 - if (!(*ret_stats =3D virHashNew(g_free))) + if (!(stats =3D virHashNew(g_free))) goto error; =20 - ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, *ret_stats, backingCh= ain); + ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain); =20 if (ret < 0) goto error; =20 + *ret_stats =3D stats; return ret; =20 error: - virHashFree(*ret_stats); + virHashFree(stats); *ret_stats =3D NULL; return -1; } --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575162; cv=none; d=zohomail.com; s=zohoarc; b=RnLQuSPh/oWjRJRSSArUWS/W1EJfFRlqZ9y+5RFSp/urbBa2wSW5xoADIRf6NiqFUUEknP/ADwqz4eOPmkbpV73RNEKrC9Q4Q3G4yYDTi/7FoJpRJiK3rOSSdOeeI8hJMMLcPrG4SoEfjI9VhJb8RWJFpJcObAtW8SVVkY/tBjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575162; 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=XokeaPRKWJOuw/6q3bIv6Ckm41C/6B5BYQy1W2CmFvA=; b=LVSYPKvdq/5V8Std17NhEWBcJ4jDxIG8zFZtFBBIThr1tKsqD7k3i0JiOwlT9Mqq6Wtmc45e6mavEXiEkcUZMkAbbEcBd32aaQs1N8DlzQMPk3f1Nyq2Wn7ODLD1FEvPajBuydMFIfyM3IedkCT03nN+U/xsYysjwQR393XUbV8= 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 16255751625447.3431053328965845; Tue, 6 Jul 2021 05:39:22 -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-339-9iTaqGlwMyq4duzU9pvpAQ-1; Tue, 06 Jul 2021 08:39:19 -0400 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 387B619251C4; Tue, 6 Jul 2021 12:38:47 +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 760367E123; Tue, 6 Jul 2021 12:38:46 +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 33AE21809C99; Tue, 6 Jul 2021 12:38:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CcigR002030 for ; Tue, 6 Jul 2021 08:38:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 54AE670F56; Tue, 6 Jul 2021 12:38:43 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F34978310; Tue, 6 Jul 2021 12:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575161; 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=XokeaPRKWJOuw/6q3bIv6Ckm41C/6B5BYQy1W2CmFvA=; b=IsEs7JoJT26zuqJ94vaf3xHQVMypVHZWl6F+mXMntdwKjJEjtYn5nLJed0eyfilyv6SjJg 0yj6bSua+aK6zFNnPhvm7Lt02zK/xeC8OgCOqzOkxjnaXI2uCRSdczXuJLHy6HMJBwlbq+ 5sISG4RSyfQfbh/IEvTjHy0pMXqQNjE= X-MC-Unique: 9iTaqGlwMyq4duzU9pvpAQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/11] qemuMonitorGetAllBlockStatsInfo: Use automatic memory management Date: Tue, 6 Jul 2021 14:37:52 +0200 Message-Id: <20210706123759.312072-5-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575164826100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d24531832b..6ff7302360 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2155,26 +2155,22 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, bool backingChain) { int ret; - GHashTable *stats =3D NULL; + g_autoptr(GHashTable) stats =3D NULL; + VIR_DEBUG("ret_stats=3D%p, backing=3D%d", ret_stats, backingChain); =20 QEMU_CHECK_MONITOR(mon); =20 if (!(stats =3D virHashNew(g_free))) - goto error; + return -1; =20 ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain); =20 if (ret < 0) - goto error; + return -1; =20 - *ret_stats =3D stats; + *ret_stats =3D g_steal_pointer(&stats); return ret; - - error: - virHashFree(stats); - *ret_stats =3D NULL; - return -1; } =20 =20 --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575161; cv=none; d=zohomail.com; s=zohoarc; b=RXB1z55CgJE1cdmk8QS8JFU0SAQnUNHcw5xz5HpAbD3pu3CDdPQ49H+zhTQLfdB0fINFj/MCN0UFeJ/sBcgKMVFXA+0h/xg1L5c596PBHLhapj9Wg5qJSWGyQCEU1AwvFU7QW9VudXvwz5JKpuqp0KI5mYkozpcfy61V8UfKkpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575161; 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=5pPt4hyQiAjj+oSk8SNY76ccdEP6nqf4ichN2dSy8l8=; b=XSeSwxRufEDCfAX/E53BoyW/4e6rTDVWTvzXLIMOBdmL2Mqa3wEemGE/HjY7vt1lrcSQshaEc5IeqD+jrBSejQqpPCXr6okofu3c1fBC0Licv1UbqLMMePkfP7vDAYodxMwYPIzUS6NlEi3Jtb9GBPoitRpA8QMOeFAAJ8AO0Yo= 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 1625575161368896.9332332969569; Tue, 6 Jul 2021 05:39:21 -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-484-dqnQ8hQKMY6T-LF__kdcLQ-1; Tue, 06 Jul 2021 08:39:18 -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 92F7A8C9C83; Tue, 6 Jul 2021 12:38:47 +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 3995B2EB22; Tue, 6 Jul 2021 12:38:47 +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 E3BD31809C99; Tue, 6 Jul 2021 12:38:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CckXI002040 for ; Tue, 6 Jul 2021 08:38:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD63C1AC77; Tue, 6 Jul 2021 12:38:44 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C03970F5E; Tue, 6 Jul 2021 12:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575160; 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=5pPt4hyQiAjj+oSk8SNY76ccdEP6nqf4ichN2dSy8l8=; b=IDxhB+0RdrEQ+aiYuMnxV+MVMH4q3mMN/jLi6xUUt1uI6gqaFbqhP8SJoXTGSlO2ze4awe KEOhT/6AFGJJAdGs6/+YAP4eYh6ItzZvj8wm5noscW2tqnMwbW2kH/2NdKa2hp3yWVQOJd 6SChKmGpDouBmIHMC+7eSlZDtG87nEE= X-MC-Unique: dqnQ8hQKMY6T-LF__kdcLQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 05/11] qemuMonitorGetAllBlockStatsInfo: `virHashNew` cannot return NULL Date: Tue, 6 Jul 2021 14:37:53 +0200 Message-Id: <20210706123759.312072-6-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575163731100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6ff7302360..dd0658f93c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2155,15 +2155,12 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, bool backingChain) { int ret; - g_autoptr(GHashTable) stats =3D NULL; + g_autoptr(GHashTable) stats =3D virHashNew(g_free); =20 VIR_DEBUG("ret_stats=3D%p, backing=3D%d", ret_stats, backingChain); =20 QEMU_CHECK_MONITOR(mon); =20 - if (!(stats =3D virHashNew(g_free))) - return -1; - ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain); =20 if (ret < 0) --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575159; cv=none; d=zohomail.com; s=zohoarc; b=f7SgxkoAt7Pa3SNcydKTOap2qwUbaiBVHyvB948w0FuBNqHw6m9l+P1sgKzBXQiHo2oTWotpmuyK/8NiI8uFrFVrQR3/pvgAH1zMCQeTxbBKzt/83dVbKy8oz63HmZb+LzmUt8YPn+9tjTSDVXaZ+DO3PRs9eaulJEiPRIMEAKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575159; 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=L0JyuJjoguTbI3HPmbl5nJiIeXD71jSFdUGsgN5ww7E=; b=XYoe2rz5xmFQV0oWJHewyRtXIeaasGOeYl7H0du37UDS3aA8axcIgXA90WeJL8OSWakSjcd9YnJ50ogyd+Vqk7NQZ4H3AYz+A7aHqVEOiED4xM4CCJTYbSrJAmx4JKYcrDLGLwd4gAPJ+3FxIiiq5kE9hw7wwbHiOMnp+ndzEGA= 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 1625575159176546.9361098876611; Tue, 6 Jul 2021 05:39: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-249-UKtUbatMPxi-zegT2IKvTQ-1; Tue, 06 Jul 2021 08:39:16 -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 A1D081019985; Tue, 6 Jul 2021 12:38:50 +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 73E41E716; Tue, 6 Jul 2021 12:38: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 2F7E31809C9A; Tue, 6 Jul 2021 12:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166Cck4S002046 for ; Tue, 6 Jul 2021 08:38:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id E236178712; Tue, 6 Jul 2021 12:38:45 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0D2678C1C; Tue, 6 Jul 2021 12:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575158; 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=L0JyuJjoguTbI3HPmbl5nJiIeXD71jSFdUGsgN5ww7E=; b=EWQ8f9bgoaWbLylyXRlEr3tykhHnW9rYXLbJyTENCzLRJ2AxdpvflFl3Kl8+F9Ch1YDb+H 2V4DhvCGv+uhTk3v1w1sSp7ZD0reDngcOpZe1UvDn9+AJbLKjrAJgqzrws5NmUJd0R8aal eAWpiItuMNLg2Pw5l1Kw6t/KoKG73sY= X-MC-Unique: UKtUbatMPxi-zegT2IKvTQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 06/11] qemuMonitorGetBlockInfo: Remove superfluous variable "ret" Date: Tue, 6 Jul 2021 14:37:54 +0200 Message-Id: <20210706123759.312072-7-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575161423100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index dd0658f93c..933d4a0154 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2103,7 +2103,6 @@ qemuDomainDiskInfoFree(void *value) GHashTable * qemuMonitorGetBlockInfo(qemuMonitor *mon) { - int ret; GHashTable *table; =20 QEMU_CHECK_MONITOR_NULL(mon); @@ -2111,9 +2110,7 @@ qemuMonitorGetBlockInfo(qemuMonitor *mon) if (!(table =3D virHashNew(qemuDomainDiskInfoFree))) return NULL; =20 - ret =3D qemuMonitorJSONGetBlockInfo(mon, table); - - if (ret < 0) { + if (qemuMonitorJSONGetBlockInfo(mon, table) < 0) { virHashFree(table); return NULL; } --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575167; cv=none; d=zohomail.com; s=zohoarc; b=FAqpkUhgg9DbGReFLRDPgqSC45EuRGZ4Iu81+1FwutP5qlAa8Tq8H3GkTNKCCpYW4ob46SgM9MN/Mv6ROk3sUlC0gOClWFqyZmjFUGIqmLoUAjj4sGeTCJQKP5fXN1612qqd75Hzbsv/fwTUHhNPlUNSP2fWog89iaLkpR8Zm14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575167; 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=lyc+j6nqLVS3cyJKf+REGUq+1DW15Z93/YzskDgmFLw=; b=QyD+Vk79r7VHXw0H4Kfu/+TlHSuT4uGhdLBzpw0BC2mH7pCJ9iVz3y7jgvPrGdAI4p4FZTKMy/oRB89GQoVrzbKUo0yJK60rbYaBS9BrW3GCoE4aM9tobrfiH5BqMCJorcFDKqOT/mNlghB7z9wo3hdULBnVPGtHSFlLk399Z7o= 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 1625575167348749.5275626189083; Tue, 6 Jul 2021 05:39:27 -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-363-Q6f4eZnwN1S0Nomms8rdPg-1; Tue, 06 Jul 2021 08:39:25 -0400 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 ACE35192FDC6; Tue, 6 Jul 2021 12:38:53 +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 8E37060CA1; Tue, 6 Jul 2021 12:38:53 +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 530024EA38; Tue, 6 Jul 2021 12:38:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CclOJ002056 for ; Tue, 6 Jul 2021 08:38:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id A394470F5A; Tue, 6 Jul 2021 12:38:46 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id E078378322; Tue, 6 Jul 2021 12:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575166; 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=lyc+j6nqLVS3cyJKf+REGUq+1DW15Z93/YzskDgmFLw=; b=M9ZORtAVFi3CM3ixWvLHGzFTzPpy3UlDO3buSOTHiYQ2v840mzg4HbAS4ozzYSFYsZs+e8 TDSoo+5DMnXqUEQtzu0FBUcrxo9X5c304HEGv/QHB0zAFvGeP+ktYDheI8j9KyI/3kyVAm BOXmfdBAtEfWxN6oDvgyC0EuEV/MwSw= X-MC-Unique: Q6f4eZnwN1S0Nomms8rdPg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/11] qemuMonitorGetBlockInfo: Use automatic memory management Date: Tue, 6 Jul 2021 14:37:55 +0200 Message-Id: <20210706123759.312072-8-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575169309100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 933d4a0154..2253c96cb5 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2103,7 +2103,7 @@ qemuDomainDiskInfoFree(void *value) GHashTable * qemuMonitorGetBlockInfo(qemuMonitor *mon) { - GHashTable *table; + g_autoptr(GHashTable) table =3D NULL; =20 QEMU_CHECK_MONITOR_NULL(mon); =20 @@ -2111,11 +2111,10 @@ qemuMonitorGetBlockInfo(qemuMonitor *mon) return NULL; =20 if (qemuMonitorJSONGetBlockInfo(mon, table) < 0) { - virHashFree(table); return NULL; } =20 - return table; + return g_steal_pointer(&table); } =20 =20 --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575158; cv=none; d=zohomail.com; s=zohoarc; b=KQRjtnFK48UWrvlvnXIRo4UOi6UQ8vdybtuY2hjLlNoZguR4PqbpMu52axH7e6IrGv0L3vso28j53M+78bOshZQABIM0kM8J1TZs0DOvUiiDm1zJAY32UGiA4HOmrRkChkwRbKCtMrOGWyHcza8x2QyKZ6ytH5P2saAdha9CVVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575158; 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=DIQ5unUqPVzKaMWbxNdZx9kUHicJALxFQ91waDqtQos=; b=EQqhyN/ZNz9kDMtKZdvm5xyN2O3xF8SgtnE1lKoeHmERDll1zDhBhIkbOvVpelRfWIe0Cs12st9BtWyPUSqNGR411+xkL/YtSFstsbg3p4DGgy3AHz01ehiKJ8SDOqXDrBwIQ+R36vCrcAl4L0y42UiEs7i6TwZ6XmDul2ieYw4= 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 1625575158971163.86370831350234; Tue, 6 Jul 2021 05:39:18 -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-174-cJBbEzXiPIOhBipcdm8DVA-1; Tue, 06 Jul 2021 08:39:16 -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 7B6DF1019626; Tue, 6 Jul 2021 12:38: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 5420F171F4; Tue, 6 Jul 2021 12:38: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 1B7964EA2A; Tue, 6 Jul 2021 12:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166Ccm8N002066 for ; Tue, 6 Jul 2021 08:38:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E8A078EBE; Tue, 6 Jul 2021 12:38:48 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id F027B78C07; Tue, 6 Jul 2021 12:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575158; 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=DIQ5unUqPVzKaMWbxNdZx9kUHicJALxFQ91waDqtQos=; b=hRcpFvNO6hUN85SzbRRY8a9aLdtOtqhwZBLlCTH8E8bNy39ay1XLja4bfw4GVeRhk4jx39 PTLMTeLTf5AuI/WOl/NVnB9qHywOngcU0sGwc+6Fud5K9s2Gkwiv7AHKuVDaPJx/vkplkg ZYJ1KzQ2QnGmKWLULIsmNfDJ0ABxYp4= X-MC-Unique: cJBbEzXiPIOhBipcdm8DVA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 08/11] qemuMonitorGetBlockInfo: `virHashNew` cannot return NULL Date: Tue, 6 Jul 2021 14:37:56 +0200 Message-Id: <20210706123759.312072-9-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575161200100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2253c96cb5..f2c35ab173 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2103,13 +2103,10 @@ qemuDomainDiskInfoFree(void *value) GHashTable * qemuMonitorGetBlockInfo(qemuMonitor *mon) { - g_autoptr(GHashTable) table =3D NULL; + g_autoptr(GHashTable) table =3D virHashNew(qemuDomainDiskInfoFree); =20 QEMU_CHECK_MONITOR_NULL(mon); =20 - if (!(table =3D virHashNew(qemuDomainDiskInfoFree))) - return NULL; - if (qemuMonitorJSONGetBlockInfo(mon, table) < 0) { return NULL; } --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575164; cv=none; d=zohomail.com; s=zohoarc; b=dGMfgGk8ivpoc3hfhaGGNHnhlowqD2clqs6iVVr3H/2M0ShjUza+V0ZhMBYaLuIqxygLE94483U2Ae4SF+Bp70cJdLzTDEWz7L+ZpdY3xPIWDudFwTQE/jniV6siyXxvnAorg5OMOJui8iMSB8SBolKGiUjAcN76kf7GbWSzS90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575164; 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=izO8xeuy9VT5yWLjsnyTt8/i63zsubHuOW84gg/PQNg=; b=BZBthMZlQ2ipTD4KeoOM27sCyOdFwWo7QAE95irvYA7S/lGw6Rp9Uy00krQyn9rFu4sPP7+Zzru/pbhiytcQGajCThX4LEO6UGmfIlDdwJxi9A7kt9fU7CFKTJptxwTMn+J2OW19yDRn7sHQc+NG27XcvTxVqQ0q0Cmc3trHYRc= 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 1625575164494311.3254280822513; Tue, 6 Jul 2021 05:39:24 -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-264-Jmj4ecakOtqEtroRrANLeg-1; Tue, 06 Jul 2021 08:39:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94D0D819048; Tue, 6 Jul 2021 12:38:56 +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 679F610372C2; Tue, 6 Jul 2021 12:38:56 +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 084AF4EA37; Tue, 6 Jul 2021 12:38:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CcoGx002083 for ; Tue, 6 Jul 2021 08:38:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FE9195F88; Tue, 6 Jul 2021 12:38:49 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1238978C1E; Tue, 6 Jul 2021 12:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575163; 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=izO8xeuy9VT5yWLjsnyTt8/i63zsubHuOW84gg/PQNg=; b=H0NsaI03wzVG0u5cvJJK25xoF0YBG9Zio0STkuNaKRRgFLLAZbq7lMlUSLzd78zEFhMnG3 UoWgdt1EvUHNsuR0y/ct6sCmK9+SSK5UMhn+kTYUDZLOFkcqgg+1d7GIJTtDeTkKy3McUj 523sjf52YMRdZAzGFrHPHbIquJuUUdE= X-MC-Unique: Jmj4ecakOtqEtroRrANLeg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/11] qemuMonitorGetChardevInfo: Remove superfluous variable "ret" Date: Tue, 6 Jul 2021 14:37:57 +0200 Message-Id: <20210706123759.312072-10-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575166109100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f2c35ab173..cb59fc7b7b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2884,7 +2884,6 @@ int qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo) { - int ret; GHashTable *info =3D NULL; =20 VIR_DEBUG("retinfo=3D%p", retinfo); @@ -2894,9 +2893,7 @@ qemuMonitorGetChardevInfo(qemuMonitor *mon, if (!(info =3D virHashNew(qemuMonitorChardevInfoFree))) goto error; =20 - ret =3D qemuMonitorJSONGetChardevInfo(mon, info); - - if (ret < 0) + if (qemuMonitorJSONGetChardevInfo(mon, info) < 0) goto error; =20 *retinfo =3D info; --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575277; cv=none; d=zohomail.com; s=zohoarc; b=MYa4cqR22c3mkVqITkQQvuofpYt7y6q6mNvBOVOQ0PCVo8yug3IP39RSRZQYQwBAnDzLvoHQ/1WOTlhYwCPKL4+Djn3UAMbVxL0vF5hyR28AMvgU1luTHL3/zJ5H2LTMm0YhaBkjHBB3ummLSvoo8jIlkEXZu5pfTPnF+T0moMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575277; 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=PCtulzPFFH490ln3divN6HPeaykF0DB87bZC2eM2Tw8=; b=cHd+yVXgti12icPdNCHvVjEAngWW9Zax1yqkUt0/NVoLrt4TSrEmGnlij5yPUv/apCRsV650Yw6YjgdHnHoSg/2oCb9equz26sE7qBxaFXkqyz4A2qXrvZ9NKFSb32P4Cd2KvwfRvg75FxfHZklsO0Gul/JhB5TV1ksm3w/V47Q= 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 1625575277542684.6986226959918; Tue, 6 Jul 2021 05:41:17 -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-273-MnyxDqM6ON6tvwwWFv46sg-1; Tue, 06 Jul 2021 08:39:25 -0400 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 A383B192FDD9; Tue, 6 Jul 2021 12:38:54 +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 7AD1E5D6A1; Tue, 6 Jul 2021 12:38:54 +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 4849F1809C99; Tue, 6 Jul 2021 12:38:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CcqOU002116 for ; Tue, 6 Jul 2021 08:38:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 45B6D7DA2A; Tue, 6 Jul 2021 12:38:51 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2146B9226D; Tue, 6 Jul 2021 12:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575276; 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=PCtulzPFFH490ln3divN6HPeaykF0DB87bZC2eM2Tw8=; b=HHTLpIjo/VDiggZaBhyXFn4DXk8khi27vyGmi76X4YcBfIoF2c/TGK0A7ZA2B6XuPdWVUq wttTUK6o2ZBtCdlJNBO90fW9C9JKbF/gBBaBH21UEEMo7qkEt0Mrl1BB+knYoEI1KA/m3X KuuRCUbd95ka1lqnMKc+LHGN+DcNMYM= X-MC-Unique: MnyxDqM6ON6tvwwWFv46sg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 10/11] qemuMonitorGetChardevInfo: Use automatic memory management Date: Tue, 6 Jul 2021 14:37:58 +0200 Message-Id: <20210706123759.312072-11-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575279570100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index cb59fc7b7b..4489b809f4 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2884,25 +2884,21 @@ int qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo) { - GHashTable *info =3D NULL; + g_autoptr(GHashTable) info =3D NULL; =20 VIR_DEBUG("retinfo=3D%p", retinfo); =20 - QEMU_CHECK_MONITOR_GOTO(mon, error); + QEMU_CHECK_MONITOR(mon); =20 + *retinfo =3D NULL; if (!(info =3D virHashNew(qemuMonitorChardevInfoFree))) - goto error; + return -1; =20 if (qemuMonitorJSONGetChardevInfo(mon, info) < 0) - goto error; + return -1; =20 - *retinfo =3D info; + *retinfo =3D g_steal_pointer(&info); return 0; - - error: - virHashFree(info); - *retinfo =3D NULL; - return -1; } =20 =20 --=20 2.31.1 From nobody Thu May 2 13:06:40 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=1625575209; cv=none; d=zohomail.com; s=zohoarc; b=f9Pck7tKF5ysXHEdDRf4FEHCuOEjXh9FiYgebUp0k286S1mdEmDY69cZVTXGEPYBx2l0IF391zS96s7B4A/EJMPuVd6f65t7HYEwI4dAIZotEXjPs4S/1tEB6YrdFrA1RBDdiWiOG3zMiQgmH2qPdtqjPZRXsCiomXJ5/aMoLKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625575209; 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=lKEjVH0D+EpP5Vumzlww+INH7ZpnckEoKioRNlJNi+o=; b=db70QO/EPCMlf7lA2hbm2fAVWKHwcJUpSUnHjMRMocWQEt4h2Y+mnDBl2u1X2YtIcZm/le0nfU3J1yn0hJgfh6jyVQRHkE6nkERRHM64CuBPhg1zyU+XztP4QGLbXUhuQu8FihVM9W1O/Grs6/wygkBdDc8NcAMnn6gVqvfz4Uk= 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 1625575209133419.44416439474765; Tue, 6 Jul 2021 05:40:09 -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-604-qxu9-ERdM666Rz8uhWImGQ-1; Tue, 06 Jul 2021 08:39:24 -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 443A791164; Tue, 6 Jul 2021 12:38:59 +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 0799F2EB19; Tue, 6 Jul 2021 12:38:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C3BBC1809C99; Tue, 6 Jul 2021 12:38:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166CcqL3002118 for ; Tue, 6 Jul 2021 08:38:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id A87C7CF95A; Tue, 6 Jul 2021 12:38:52 +0000 (UTC) Received: from work.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4028C7DA1F; Tue, 6 Jul 2021 12:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625575208; 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=lKEjVH0D+EpP5Vumzlww+INH7ZpnckEoKioRNlJNi+o=; b=DmXecJvAdhTUw32Y5IbQ2JbXTk59O/M5Uzl29JfBPXm1P5ofHMj/ItzSfnjEYevlV7cEKu oZhMUBVsyPkQIoHSnaCok3MyqHdEiFNbUzohFzYVmfnIQfmdKq6a2jDAgFtrYwwGriF2NL O/6C9UXr8FNr5D+dE1Dx8u5JBLHFwjs= X-MC-Unique: qxu9-ERdM666Rz8uhWImGQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 11/11] qemuMonitorGetChardevInfo: `virHashNew` cannot return NULL Date: Tue, 6 Jul 2021 14:37:59 +0200 Message-Id: <20210706123759.312072-12-twiederh@redhat.com> In-Reply-To: <20210706123759.312072-1-twiederh@redhat.com> References: <20210706123759.312072-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1625575211649100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 4489b809f4..ef24b2ca1e 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2884,16 +2884,13 @@ int qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo) { - g_autoptr(GHashTable) info =3D NULL; + g_autoptr(GHashTable) info =3D virHashNew(qemuMonitorChardevInfoFree); =20 VIR_DEBUG("retinfo=3D%p", retinfo); =20 QEMU_CHECK_MONITOR(mon); =20 *retinfo =3D NULL; - if (!(info =3D virHashNew(qemuMonitorChardevInfoFree))) - return -1; - if (qemuMonitorJSONGetChardevInfo(mon, info) < 0) return -1; =20 --=20 2.31.1