From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1599824562; cv=none; d=zohomail.com; s=zohoarc; b=b6KmMUz1XHRT4KUXQI1HIPjnjZUBJsPw18RrSsn1YufOkcqgEwmc+dPh/1HHsiip0S09w6/2oIBPtmRdjuPENomwjQXG+36woSCh9ZSIdUy26naWHQ2sakgukixIR4VL5RM3WZDCbh17gS5W82VABTQhNW9nmBimTSvWcIVoqcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824562; 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=e1NrhnhVuXQkDBFdXV2apD0EKgIJ1LGIZ5S1hLimO5I=; b=I755PZ7rCoCi2R5I3MYVGyPle5/NUVBeY7Sfk4rfVWox9sPkwGTZ+MvbQAt5y8jUjVG3kolVnv2WH02L9JI9Fblu4lhscaM0bn0F+X/sjbFzBN+OE3sgTJCI9Ep3w0wLO7mp8QTJ0QmkvOOE/PdK8K9cIJFnY2dcyqyMvUW9YVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599824562037785.7407668697149; Fri, 11 Sep 2020 04:42:42 -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-425-zfwJd0jzP8irVQsSJMzi9w-1; Fri, 11 Sep 2020 07:42:38 -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 CF84418B9EE5; Fri, 11 Sep 2020 11:42:32 +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 A94C71852A; Fri, 11 Sep 2020 11:42:32 +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 78013180B65D; Fri, 11 Sep 2020 11:42:32 +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 08BBgO5c010593 for ; Fri, 11 Sep 2020 07:42:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 49A475D9F7; Fri, 11 Sep 2020 11:42:24 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91FE95D9E8; Fri, 11 Sep 2020 11:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824560; 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=e1NrhnhVuXQkDBFdXV2apD0EKgIJ1LGIZ5S1hLimO5I=; b=WMiKHw47jaZezkfWk8R2GrNY21JPb85JOqPHsV2nORarLSzAPdRkEmm/lJY4Bm1bfIzyRf bvuDd1WrVSsF8/oQj57NnDYdUWD2Z1yRXoN3X281zM2xIc/bZb/yI+m3spamClmDLZ4pH7 LlUl9Se7CWwI+vcPn32gnxSipegherE= X-MC-Unique: zfwJd0jzP8irVQsSJMzi9w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/21] tests: Use glib memory functions in virpcimock.c Date: Fri, 11 Sep 2020 13:41:58 +0200 Message-Id: <20200911114218.489636-2-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- tests/virpcimock.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 92b6f810d8..6b1f2f2a5a 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -427,9 +427,7 @@ pci_device_create_iommu(const struct pciDevice *dev, return; } =20 - if (VIR_ALLOC_QUIET(iommuGroup) < 0) - ABORT_OOM(); - + iommuGroup =3D g_new0(struct pciIommuGroup, 1); iommuGroup->iommu =3D dev->iommuGroup; iommuGroup->nDevicesBoundToVFIO =3D 0; /* No device bound to VFIO by d= efault */ =20 @@ -469,8 +467,7 @@ pci_device_new_from_stub(const struct pciDevice *data) c =3D strchr(c, ':'); } =20 - if (VIR_ALLOC_QUIET(dev) < 0) - ABORT_OOM(); + dev =3D g_new0(struct pciDevice, 1); =20 configSrc =3D g_strdup_printf("%s/virpcitestdata/%s.config", abs_srcdi= r, id); =20 @@ -694,8 +691,7 @@ pci_driver_new(const char *name, ...) int vendor, device; g_autofree char *driverpath =3D NULL; =20 - if (VIR_ALLOC_QUIET(driver) < 0) - ABORT_OOM(); + driver =3D g_new0(struct pciDriver, 1); driver->name =3D g_strdup(name); if (!(driverpath =3D pci_driver_get_path(driver, NULL, true))) ABORT_OOM(); --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824567; cv=none; d=zohomail.com; s=zohoarc; b=DKAL+DaY5Umv5JIKPnviXNiIfbUwBh9v2PaPd8xHo7KqpmEEKpicCXtUU0LcBb66Hgv4jkyoo6SyPQOSNVKT6X90PvKact6e3pKASYWF6QxfeYwNFbghOc0GHuqc9HKIA5IkUoAQHicsC9SOZMALqgBP0OQ3QKbvKEBFfNe2aPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824567; 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=eqtJGe6jYY8klSUPOq1o1RzKZaBR/3ZtsTMt/vfg2R0=; b=nwf+WdVQ8QvvDQygp0i8CdUwW1VMghAAbcaBuDpHQii6sYCdDUEO/3GM4GfUcGBUdzNrXNXs7VaKoDwDptVp3JkZePwC7ALnKeBSduuI2kGQYXITLfBfo9O4VRWeEznjIp5X1XIL4NOEMS8/tlMkKEgMWMcgpKezur13RkrJqlw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824567070735.0389233029513; Fri, 11 Sep 2020 04:42:47 -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-138-_liodWZsOBGQaQ4lTIVMiQ-1; Fri, 11 Sep 2020 07:42:43 -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 6AAD581CBE7; Fri, 11 Sep 2020 11:42:35 +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 4332819C66; Fri, 11 Sep 2020 11:42:35 +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 12B6292309; Fri, 11 Sep 2020 11:42:35 +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 08BBgPtd010604 for ; Fri, 11 Sep 2020 07:42:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 548935D9F3; Fri, 11 Sep 2020 11:42:25 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B5A35D9E8; Fri, 11 Sep 2020 11:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824565; 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=eqtJGe6jYY8klSUPOq1o1RzKZaBR/3ZtsTMt/vfg2R0=; b=ZSjngA49/S0+2t1eEksWnxS8GchRM9lvVNgXg0kJHV6jerYxGIesujwKjn6Y9ld400EN2n /Et/hMuWoqDnv6H8ABSMVq8zgxTifieYnURnQVV37yOvxu1Ej74tOjuDOqEqACU7o+nayF jhTTN/hsOD5XloehomRKwnhp2ZCPly0= X-MC-Unique: _liodWZsOBGQaQ4lTIVMiQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/21] rpc: Use glib memory functions in virNetMessageSaveError Date: Fri, 11 Sep 2020 13:41:59 +0200 Message-Id: <20200911114218.489636-3-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetmessage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c index c4ddafc01d..6423ce67a3 100644 --- a/src/rpc/virnetmessage.c +++ b/src/rpc/virnetmessage.c @@ -539,8 +539,8 @@ void virNetMessageSaveError(virNetMessageErrorPtr rerr) } else { rerr->code =3D VIR_ERR_INTERNAL_ERROR; rerr->domain =3D VIR_FROM_RPC; - if (VIR_ALLOC_QUIET(rerr->message) =3D=3D 0) - *rerr->message =3D g_strdup(_("Library function returned error= but did not set virError")); + rerr->message =3D g_new0(virNetMessageNonnullString, 1); + *rerr->message =3D g_strdup(_("Library function returned error but= did not set virError")); rerr->level =3D VIR_ERR_ERROR; } } --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599824570; cv=none; d=zohomail.com; s=zohoarc; b=kqgC1ry/rU/51BxBdEbxTk7UW3pQiyq/ll3zk3Wg+i1cX+/aEPTZoQdXlAPZaTRIC/oXu979qcKJKv5z/gYDOm+wtyGwtSsoEL2hyq88Rg2XmhzsFrwLEi8BHx7P3bHABoLCk9JS5zOcQCdLWgGoetshSlaau/pXNCAEGFyOqEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824570; 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=1HMu9dYRb1eKmahgs3sxAJqTO4nrrxJc1EgLnzfVmKQ=; b=aDiNxIBUML9bOF1v9KEXbLY5Kuuw/EOyWg5+gd4w0E3wPNHypicIM6y+i8wrW+JwXiMl8MGbYdNGHogrTu5msk1IE84sf4fdlJtJ9zo6hqG0DzaUptPEvIrGRtb0sN0gcCvW+MZ4LSqiGcl1Rql1UWNaeOCXFnKucTHAXluFbVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824570880431.05813734296316; Fri, 11 Sep 2020 04:42:50 -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-169-M_raSFepNaC7gnQdvp5duA-1; Fri, 11 Sep 2020 07:42:47 -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 E519C81F00B; Fri, 11 Sep 2020 11:42:37 +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 C06E57512C; Fri, 11 Sep 2020 11:42:37 +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 8D38E18198E2; Fri, 11 Sep 2020 11:42:37 +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 08BBgQ5e010613 for ; Fri, 11 Sep 2020 07:42:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 623195D9F7; Fri, 11 Sep 2020 11:42:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id A71AB5D9E8; Fri, 11 Sep 2020 11:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824569; 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=1HMu9dYRb1eKmahgs3sxAJqTO4nrrxJc1EgLnzfVmKQ=; b=LgOyNi9NMLHOYnQdeTBGle235bTQpumZ3ozXCZCbA6M0qUoaVM7gjY4ipMtrENd1j4fVkw WIolarf0y9u7eIncILC3bOo/N+f5BzwgVJphb4JXXc9FxedwDZPFAwJgQFB6Cw6FbZ1nYJ 3z4m5/+oyFWbIpeSJWxVsNew6FcVPcU= X-MC-Unique: M_raSFepNaC7gnQdvp5duA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/21] util: Use glib memory functions in virBitmapNewQuiet Date: Fri, 11 Sep 2020 13:42:00 +0200 Message-Id: <20200911114218.489636-4-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virbitmap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 60fd8491dd..639103e518 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -69,14 +69,8 @@ virBitmapNewQuiet(size_t size) =20 sz =3D VIR_DIV_UP(size, VIR_BITMAP_BITS_PER_UNIT); =20 - if (VIR_ALLOC_QUIET(bitmap) < 0) - return NULL; - - if (VIR_ALLOC_N_QUIET(bitmap->map, sz) < 0) { - VIR_FREE(bitmap); - return NULL; - } - + bitmap =3D g_new0(virBitmap, 1); + bitmap->map =3D g_new0(unsigned long, sz); bitmap->nbits =3D size; bitmap->map_len =3D sz; bitmap->map_alloc =3D sz; --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599824559; cv=none; d=zohomail.com; s=zohoarc; b=iWNRSXZh3JrS93WAK/BSk9HWeM0t+WFAeVDjXoAx/gtJlokVFNRjreExu1MAmv272HdAvlYidNKUZRx+O4KbXdosct4YNDltDRwq7iv6hz586z4RxAz8kflHxjII5N70mX/mmrtc3S/+6+AUw09tChu1Xm0TFiOmJcntXnF71Ug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824559; 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=8QsWSMHrzHgXzvRAq+A95uVL8yhZ/C8JQR6iJLS7Y+8=; b=Pcy074PaQ9l7tFaX4uayLm/muS5pjjMRpvOlDjL/ibNzzcsKrhP8biEIibAeP2js3QoZ/zx2Z5NQhrRLZDJckNjJWUF8ArMLq6dSHp5gAxeigUR2H82uM0uHMs6yUCpcrYJ1yBs+/YLxdW3LYz0KlDO38IOUZLwBnDBC74sPJaM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824559358175.93584683569634; Fri, 11 Sep 2020 04:42:39 -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-183--fnhHzZFOwaHz9gHBOaOwg-1; Fri, 11 Sep 2020 07:42:35 -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 30464393B1; Fri, 11 Sep 2020 11:42:30 +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 0C1CB60C07; Fri, 11 Sep 2020 11:42:30 +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 C5D53922ED; Fri, 11 Sep 2020 11:42:29 +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 08BBgRKA010621 for ; Fri, 11 Sep 2020 07:42:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F5CD5D9F3; Fri, 11 Sep 2020 11:42:27 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id B51E65D9E8; Fri, 11 Sep 2020 11:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824557; 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=8QsWSMHrzHgXzvRAq+A95uVL8yhZ/C8JQR6iJLS7Y+8=; b=cX8oo/5dQCSeCZIjoeJs3It6yqYGM+V6bPdsULp/7ubOP+9frqst+I0nrX5Z7tjrJi4LSV OAlViVpsCWCWTZdwxSUYN1w6+0ICXr0hOtfidve36z12wPqZ+cIvyIZDwYK3Vduh1pj4ZC jGW0GBwVtl+pfs2fqlwwIhp+Q+uyBos= X-MC-Unique: -fnhHzZFOwaHz9gHBOaOwg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/21] util: Use glib memory functions in virErrorCopyNew Date: Fri, 11 Sep 2020 13:42:01 +0200 Message-Id: <20200911114218.489636-5-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/util/virerror.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index 507a29f50f..4ba99defbb 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -223,15 +223,14 @@ virCopyError(virErrorPtr from, virErrorPtr virErrorCopyNew(virErrorPtr err) { - virErrorPtr ret; + g_autoptr(virError) ret =3D NULL; =20 - if (VIR_ALLOC_QUIET(ret) < 0) - return NULL; + ret =3D g_new0(virError, 1); =20 if (virCopyError(err, ret) < 0) - VIR_FREE(ret); + return NULL; =20 - return ret; + return g_steal_pointer(&ret); } =20 =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1599824586; cv=none; d=zohomail.com; s=zohoarc; b=B0GY/o6NJr9Z7pTntq0VxeYW8fEJyLqHQ5LsDHTv5G7MXAudK/DU6qB+6O3xed0qhmenCQbFvwQtVNmbx0Y2YAF3Plvgz6SgbBduvz8T2SkRaAvF8PLb5cFFDYIZoFi4IzgplaxPk7AP3BOMvnrreFsagelTNDfVcEOdY/XKrFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824586; 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=Vqe7gkM+4RPB9usx5171OtbwQmkY34GQ6cg1aCygsfA=; b=mordJMeRgXk80N/89VUtHjetKkZ0tCCJRu1PjJnI2ZdKoT8bvfakEEBjBVreYJPNgB4ckxT2l/ZslRU/RzrgvsgMP8OSiGdr2RVwnhL7Ahr1RrJWkGXfZZzkZpiSF9TA4qHnzvd5BlLzrCuC5XXMd7whc+hD0CDDLEKMZf+3elc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 159982458692729.973538861624547; Fri, 11 Sep 2020 04:43:06 -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-576-PaFz6A4iNRqB4y84HywYBg-1; Fri, 11 Sep 2020 07:42:41 -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 42DB781CAFF; Fri, 11 Sep 2020 11:42:33 +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 1FCEF60C15; Fri, 11 Sep 2020 11:42:33 +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 DA197180BAFF; Fri, 11 Sep 2020 11:42:32 +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 08BBgSpn010636 for ; Fri, 11 Sep 2020 07:42:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E1B25D9F3; Fri, 11 Sep 2020 11:42:28 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4CAB5D9E8; Fri, 11 Sep 2020 11:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824585; 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=Vqe7gkM+4RPB9usx5171OtbwQmkY34GQ6cg1aCygsfA=; b=Zj8BTM2zDlXHb/jmLQEJr7EiUy/zpoZRmlLvMhwVeE8M9Iozk0qvq0WtxhkLcI3oO/lKZS GQzIddWXWLhAIhrB1lUqoxqhddTIZWzD1E0kjJ64hkHzSt+1tW6I44TAd6GYFGLetCnuiQ /zwb9DgzX4ISoPJijSL8M0ytVEQq0WM= X-MC-Unique: PaFz6A4iNRqB4y84HywYBg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/21] util: Use glib memory functions in virLastErrorObject Date: Fri, 11 Sep 2020 13:42:02 +0200 Message-Id: <20200911114218.489636-6-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/util/virerror.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index 4ba99defbb..99a0855b51 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -237,15 +237,17 @@ virErrorCopyNew(virErrorPtr err) static virErrorPtr virLastErrorObject(void) { - virErrorPtr err; + g_autoptr(virError) err =3D NULL; + err =3D virThreadLocalGet(&virLastErr); - if (!err) { - if (VIR_ALLOC_QUIET(err) < 0) - return NULL; - if (virThreadLocalSet(&virLastErr, err) < 0) - VIR_FREE(err); - } - return err; + if (err) + return g_steal_pointer(&err); + + err =3D g_new0(virError, 1); + if (virThreadLocalSet(&virLastErr, err) < 0) + return NULL; + + return g_steal_pointer(&err); } =20 =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824586; cv=none; d=zohomail.com; s=zohoarc; b=KKQpGwqB87jj95N5bQzKYIwMw1KD/5c7dILSC3awHb5WkhUNSoPJN6Fabm/hhblTg6X4Dqa8XAD6fb1ccnAl+6ItWXEry6vd7EoR+Z2kd8P/CYXgBGWbMOgJIUsNl5qaS8jmGRr+o4YolY3J4E8XKLnPHfvnPw04fg4af/3OCCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824586; 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=DxKpvRjONRHYnpTEg5QNiR10Dc1/iGwIC5GJWXYoavk=; b=k+VNuv1IXg5KSaLJNrujKfd3EdscI+OkQRzTVUGIf6Y6XuM6xdrwWaygmOui2k9Okn1zCyJXtVbwH9YEfSQvYdsy9PWFIvIQBtd4hgkr42ibO63kjO2nO9f76Cw3DzmggTZepwh58A/m2rULf7LTiVl1bUYf3o4zAKQ4b/Hp90M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824586814598.2837488133571; Fri, 11 Sep 2020 04:43:06 -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-391-hCFdT9x-MdiTl_h6ZA6j9w-1; Fri, 11 Sep 2020 07:42:46 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 611E01074661; Fri, 11 Sep 2020 11:42:40 +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 41F647E8F0; Fri, 11 Sep 2020 11:42:40 +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 0E1C5181A07B; Fri, 11 Sep 2020 11:42:40 +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 08BBgTne010646 for ; Fri, 11 Sep 2020 07:42:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C1655D9F3; Fri, 11 Sep 2020 11:42:29 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0E9F5D9E8; Fri, 11 Sep 2020 11:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824585; 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=DxKpvRjONRHYnpTEg5QNiR10Dc1/iGwIC5GJWXYoavk=; b=W2AqjqtUZW7AS2jElaUD31o8umodwDRvqIGQl69GiqkOrBfjcfNiteyaaJzhsD4cYt7nvg 7ldPm3fnVmZxgqdCG+ll7Qm24+SVRr67jPCylHgnFrVvYLGHpk9hEZQB9VSifYCiNdRyL7 PvqWaL/d0qfOU3EeD3dTqmrQCx1Cof0= X-MC-Unique: hCFdT9x-MdiTl_h6ZA6j9w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/21] util: Use glib memory functions in virSaveLastError Date: Fri, 11 Sep 2020 13:42:03 +0200 Message-Id: <20200911114218.489636-7-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index 99a0855b51..df4205043a 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -405,8 +405,7 @@ virSaveLastError(void) virErrorPtr to; int saved_errno =3D errno; =20 - if (VIR_ALLOC_QUIET(to) < 0) - return NULL; + to =3D g_new0(virError, 1); =20 virCopyLastError(to); errno =3D saved_errno; --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1599824563; cv=none; d=zohomail.com; s=zohoarc; b=gDYD/+qrXM3/FQRAMZe/F5XG38wLA4o/nPOr4WdvUZS9sVF32DeXi++VOCe44l7r1lDPNTt3L5n2Oc01NIH+SY7whASCfbmdX0tpyFcRCBAqbmYevHBkwF3fD+OVgrU35tMeU5F48rfEzF5k6Z/x2D1iBDnYJ7NpVamZDY8ouE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824563; 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=2GQ5JySE0sZNxzdxu21IVj4H9zmGgviK08GGHYlne+E=; b=BKkL80JFw1hNGP8hJ414tZE/SeuuXEHYuTO3uflZfRrPkXLt2wUt37J3pJbspnmLBRjjypnNTtqsKnLWio3QmdIWIVOSyo8Q8GFkFyxXgKE5EnFmDpBC90KPLdc2c+3GKi5XofZsPevObMIMOHWwtDF4oAEyCeuDDQo+E758rCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599824563837899.3180798189874; Fri, 11 Sep 2020 04:42:43 -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-576-uFrnzdGbOWq0HCrdm3g7TQ-1; Fri, 11 Sep 2020 07:42:40 -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 8E58681CBEB; Fri, 11 Sep 2020 11:42:33 +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 6C39375127; Fri, 11 Sep 2020 11:42:33 +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 348DC92306; Fri, 11 Sep 2020 11:42:33 +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 08BBgUSw010656 for ; Fri, 11 Sep 2020 07:42:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 954B75D9F7; Fri, 11 Sep 2020 11:42:30 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE5325D9E8; Fri, 11 Sep 2020 11:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824562; 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=2GQ5JySE0sZNxzdxu21IVj4H9zmGgviK08GGHYlne+E=; b=d/Atg22OCIwsMN9oVnbL6RhVxnF4ZWpYG3ErsWAftKLNgUIGTJYgZL1kY2tIYSzJv1C7LX A8pqb+akn0wS2Poazxi3Zb8FW70ZnKcZPGnZN1D+IwoWU30nJ4k5izTw9bpqJB8d21BqR1 Po56JauI4kfnUvRMkCUi2Y6upc73yh4= X-MC-Unique: uFrnzdGbOWq0HCrdm3g7TQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/21] util: Use glib memory functions in virLogFilterNew Date: Fri, 11 Sep 2020 13:42:04 +0200 Message-Id: <20200911114218.489636-8-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virlog.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index f6d0c6c050..de36da1a4a 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1308,7 +1308,6 @@ virLogFilterNew(const char *match, virLogPriority priority) { virLogFilterPtr ret =3D NULL; - char *mdup =3D NULL; size_t mlen =3D strlen(match); =20 if (priority < VIR_LOG_DEBUG || priority > VIR_LOG_ERROR) { @@ -1317,23 +1316,16 @@ virLogFilterNew(const char *match, return NULL; } =20 + ret =3D g_new0(virLogFilter, 1); + ret->priority =3D priority; + /* We must treat 'foo' as equiv to '*foo*' for g_pattern_match - * todo substring matches, so add 2 extra bytes + * substring matches, so add 2 extra bytes */ - if (VIR_ALLOC_N_QUIET(mdup, mlen + 3) < 0) - return NULL; - - mdup[0] =3D '*'; - memcpy(mdup + 1, match, mlen); - mdup[mlen + 1] =3D '*'; - - if (VIR_ALLOC_QUIET(ret) < 0) { - VIR_FREE(mdup); - return NULL; - } - - ret->match =3D mdup; - ret->priority =3D priority; + ret->match =3D g_new0(char, mlen + 3); + ret->match[0] =3D '*'; + memcpy(ret->match + 1, match, mlen); + ret->match[mlen + 1] =3D '*'; =20 return ret; } --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 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=1599824592; cv=none; d=zohomail.com; s=zohoarc; b=HEkO9XT74r097e5g8oirBkhgTmztYPQqql9WiRSWcSiYgqQT5QUse8kiCOeMuBMpAMFUYDUnDC7MJ+fiehzYSGkfi9T7fxiUXttwzVCKQ5mBkQT5llywtGo2aAIId05+DZxidCLrQA5VRPfZ688tEpAuZGdF4QQ190iQyHYLZM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824592; 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=sfS0rcFgZsMTlKlgQHFdbepqqDklckZsDaEkTfy+B7o=; b=Nx88CSSlfUZMuHh2V9Rd/c7EIueSOt6Wd7TggJx2v0TzrW5KmsuCY3EHaB2kTm0s/cCrszwV4tEHhYMMKOL4oiAoXVJ6aWVaZCOSQiL5vCYswNi/aDke7i1O6EcxQAUOQ+Igz1/lVjNRLgqdeqHIIqz/nSY91LEb2PtBXzA0AG4= 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) header.from= 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 1599824592464326.6010724120863; Fri, 11 Sep 2020 04:43:12 -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-325-OqO6pb68Pi249TQwuvao1w-1; Fri, 11 Sep 2020 07:42:50 -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 E17D8800461; Fri, 11 Sep 2020 11:42: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 BEA2A5C221; Fri, 11 Sep 2020 11:42: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 8992592312; Fri, 11 Sep 2020 11:42:42 +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 08BBgVZr010671 for ; Fri, 11 Sep 2020 07:42:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id A45955D9F3; Fri, 11 Sep 2020 11:42:31 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7AB75D9E8; Fri, 11 Sep 2020 11:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824591; 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=sfS0rcFgZsMTlKlgQHFdbepqqDklckZsDaEkTfy+B7o=; b=WRAJt/EdJHSsf/6Xco30hfGArR2uK25mrIt6yKY3kDtMr+fjcnRgyBXfb/omIDSHWKOyaw YxvOUCgBzExmR3dG+a9i50EeFDf/4DW8VdtO+QgaFpxy58qctgSKqjnM2orlHvm7dVEeVp nDEOO2e72PfJm2mPVW0qkoyADaWmvfc= X-MC-Unique: OqO6pb68Pi249TQwuvao1w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/21] util: Use glib memory functions in virThreadCreateFull Date: Fri, 11 Sep 2020 13:42:05 +0200 Message-Id: <20200911114218.489636-9-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virthread.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/virthread.c b/src/util/virthread.c index 7f23399835..814f5313aa 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -253,11 +253,8 @@ int virThreadCreateFull(virThreadPtr thread, =20 if ((err =3D pthread_attr_init(&attr)) !=3D 0) goto cleanup; - if (VIR_ALLOC_QUIET(args) < 0) { - err =3D ENOMEM; - goto cleanup; - } =20 + args =3D g_new0(struct virThreadArgs, 1); args->func =3D func; args->name =3D g_strdup(name); args->worker =3D worker; --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1599824565; cv=none; d=zohomail.com; s=zohoarc; b=YyLhE0VyGYylnLht1etnuK9f0mSvbSYtRUgftn3jZMWHgu0NfK+d8oQtvX6clCm+V3Ui9vERtoSp1FJDqDCbwEAv1w/zN5j4ciXdPSKqaePT0tSXqLYc09WRQpXxyuKQ+Ilvfd6I98OjWfmCpbsqXsSXOquCS6SQJY/0SlBNNaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824565; 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=BmOG0Yr+7SWhRcSVdFbCym1sXNNckF6L9aSgMT1MO4s=; b=Fi4K+jGt/JGwauYe7yec/tWTFaJTHFvR1gvUW8QLDsV6gTnz83tIjk/zYb7cr39LLE94wX7PxUZTwo+W8zvduKXgJ3DI53HXGqShv2aNeLdkRTBUzzfkTM1z9PU0doXfEM89pwq0xvCJ7AiZXfGrjEN0PsWAqa9BOFUwxYZ156o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1599824565537124.95880304817672; Fri, 11 Sep 2020 04:42:45 -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-596-A2gCkSSlOBCjE40PbLBLaQ-1; Fri, 11 Sep 2020 07:42:42 -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 F2D6718B9EEE; Fri, 11 Sep 2020 11:42:35 +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 CE4DB19C59; Fri, 11 Sep 2020 11:42:35 +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 9DA239230D; Fri, 11 Sep 2020 11:42:35 +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 08BBgWc0010676 for ; Fri, 11 Sep 2020 07:42:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B2B545D9F3; Fri, 11 Sep 2020 11:42:32 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01FCF5D9E8; Fri, 11 Sep 2020 11:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824564; 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=BmOG0Yr+7SWhRcSVdFbCym1sXNNckF6L9aSgMT1MO4s=; b=JTxWFLb3Z9pKcyFiC3/gs9NhEXD1TVmyGHKybyWejoKd6xKb0+Ght+RNHnWkC/QGxPuTZt lATLU5WtqWsu2kpruP7uMvDA9oMEzEpe9IC9ja2YGboNm89+3222SAI3Vr09iPO2rMmc8z wOynlUMNcMq6clHVpHrerRArBy5SCm8= X-MC-Unique: A2gCkSSlOBCjE40PbLBLaQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/21] util: Remove VIR_ALLOC_QUIET Date: Fri, 11 Sep 2020 13:42:06 +0200 Message-Id: <20200911114218.489636-10-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/viralloc.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index 833f85f62e..ae967f2556 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -75,20 +75,6 @@ void virDisposeString(char **strptr) */ #define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr))) =20 -/** - * VIR_ALLOC_QUIET: - * @ptr: pointer to hold address of allocated memory - * - * Allocate sizeof(*ptr) bytes of memory and store - * the address of allocated memory in 'ptr'. Fill the - * newly allocated memory with zeros. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_ALLOC_QUIET(ptr) VIR_ALLOC(ptr) - /** * VIR_ALLOC_N: * @ptr: pointer to hold address of allocated memory --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1599824571; cv=none; d=zohomail.com; s=zohoarc; b=dtFyLTPGL84N89miC6oRLbRg308gnx0BiXkfrUeVBWRdC96JVWp8Ne9AzVgccTkRu0pkQSv74j1jFbAh03d+nSSS/x+ZCbHZcZJIcngLSIZXEY4Rx4kRm62MuRkf1xV/MY7enGtfPnZFuhNbEPMX7flVcUoAvuZZh28rkx65tig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824571; 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=PJZcorXRVc3tBCd81/sncXDReUVcbTg6P3dOMVg8RhA=; b=HEXX9/Uo6PnvOF9r6DLgHwm25tFsqLA+YpnKtXlppH0eGSVz+4eHhwvGCdV6mZhKXJ30a/4HUxs+LtvMXb5nnHlwvVJ5DHTjwLRHBaQ/VZNUTDFWEsEunWYaCex3sfe2bl67OGSkGTE8tAGOYPeVppifQpK65Nt8uCfYINwC7dc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599824571276827.3093363752363; Fri, 11 Sep 2020 04:42:51 -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-348-bY3gjZkrM1qzIkNlUyzMpg-1; Fri, 11 Sep 2020 07:42:47 -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 71658420EA; Fri, 11 Sep 2020 11:42:38 +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 508647EB97; Fri, 11 Sep 2020 11:42:38 +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 1C8F7181A050; Fri, 11 Sep 2020 11:42:38 +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 08BBgXEk010687 for ; Fri, 11 Sep 2020 07:42:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1E6D5DA2A; Fri, 11 Sep 2020 11:42:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12B945D9F3; Fri, 11 Sep 2020 11:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824570; 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=PJZcorXRVc3tBCd81/sncXDReUVcbTg6P3dOMVg8RhA=; b=hai0QkxILLiHxnD45Kf+z3i5TK4JhEsMFhBy6gQNHnENTJTFFW025Quh2uOm9sMMQGulSF jmLlQStaPl0smpQqSJvMZj/CvgIdOyVdZ/swCmpqvHD7vZVKEf0ZDqQfKx1kqz9T4Lexd/ MyzNBFrQ3tOwHIbVeu34Ix8JNJwTbGQ= X-MC-Unique: bY3gjZkrM1qzIkNlUyzMpg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/21] tests: Use glib memory function in testConfRoundTrip Date: Fri, 11 Sep 2020 13:42:07 +0200 Message-Id: <20200911114218.489636-11-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This also fixes a (hypothetical) bug where testConfRoundTrip would return 0= if virConfWriteMem() returned 0 and virTestCompareToFile failed. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- tests/virconftest.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/tests/virconftest.c b/tests/virconftest.c index ab29b5b712..c683344f49 100644 --- a/tests/virconftest.c +++ b/tests/virconftest.c @@ -32,40 +32,31 @@ static int testConfRoundTrip(const void *opaque) { const char *name =3D opaque; - int ret =3D -1; g_autoptr(virConf) conf =3D NULL; int len =3D 10000; - char *buffer =3D NULL; - char *srcfile =3D NULL; - char *dstfile =3D NULL; + g_autofree char *buffer =3D NULL; + g_autofree char *srcfile =3D NULL; + g_autofree char *dstfile =3D NULL; =20 srcfile =3D g_strdup_printf("%s/virconfdata/%s.conf", abs_srcdir, name= ); dstfile =3D g_strdup_printf("%s/virconfdata/%s.out", abs_srcdir, name); =20 - if (VIR_ALLOC_N_QUIET(buffer, len) < 0) { - fprintf(stderr, "out of memory\n"); - goto cleanup; - } + buffer =3D g_new0(char, len); conf =3D virConfReadFile(srcfile, 0); if (conf =3D=3D NULL) { fprintf(stderr, "Failed to process %s\n", srcfile); - goto cleanup; + return -1; } - ret =3D virConfWriteMem(buffer, &len, conf); - if (ret < 0) { + + if (virConfWriteMem(buffer, &len, conf) < 0) { fprintf(stderr, "Failed to serialize %s back\n", srcfile); - goto cleanup; + return -1; } =20 if (virTestCompareToFile(buffer, dstfile) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - VIR_FREE(srcfile); - VIR_FREE(dstfile); - VIR_FREE(buffer); - return ret; + return 0; } =20 =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824571; cv=none; d=zohomail.com; s=zohoarc; b=nWXTnN6ktTmOnqptYnyY4ilwXe3QFQlfdY0J8cIWKZDpeGNJVHZKZ7ZdpR1zzrh00kPho6TPgucxN05n6XBuUTabp5DV2lKSeemfVysZWILUAZ2Z93f2v9A95hSNhUfbqKAK6d//yDOU7XBFR8Jh0C/vX6opi+rlPXhOa/veCLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824571; 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=nujMyWzyLunhQ2wABYbQEfHjByvzMGXN46WdZ+k6Dz0=; b=f+17wvjtyAYR9DP/gX0ALBjGSTwLKOIhXV+6B/NGhPiVlEtGhPNtLrGQK/Iyz4tCpVwSxYMlU9/T1s3zel88XNo+83aNYB6vSJ2EW5z2CGm74XE68VED5+ooQS1Zyk18vZkpu65a8C14bQxotGGyjzi+Rclh5Mr1Jm1BdzFa6mk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824571730947.9958958613724; Fri, 11 Sep 2020 04:42:51 -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-380-azv7jB2eM36vUBdoz5bW7A-1; Fri, 11 Sep 2020 07:42:48 -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 060F581F028; Fri, 11 Sep 2020 11:42:41 +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 D93C55C1BD; Fri, 11 Sep 2020 11:42:40 +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 A631B92310; Fri, 11 Sep 2020 11:42:40 +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 08BBgcke010719 for ; Fri, 11 Sep 2020 07:42:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id E39125D9F3; Fri, 11 Sep 2020 11:42:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D6845DA2A; Fri, 11 Sep 2020 11:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824570; 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=nujMyWzyLunhQ2wABYbQEfHjByvzMGXN46WdZ+k6Dz0=; b=J6+c9UX8evGG3qHcVNZZzXCCGnJTpgEMX1yx1d3xNSOX8kYOHylH5ZXLySRUYN69BXp7PP lZlWd8FzCVzdbT0Lb6yF/4efyHa2vKATv7Dtqq9DthX0C4R43NsFY6H73fn4QQ42D4ECWQ G+Pgq8u5Ktg1mUaLthCnQ+UH3N05h0g= X-MC-Unique: azv7jB2eM36vUBdoz5bW7A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 11/21] util: Use glib memory functions in virDevMapperGetTargetsImpl Date: Fri, 11 Sep 2020 13:42:08 +0200 Message-Id: <20200911114218.489636-12-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virdevmapper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index 7c89c2a952..4d27c9f104 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c @@ -260,9 +260,7 @@ virDevMapperGetTargetsImpl(int controlFD, return -1; } =20 - if (VIR_ALLOC_N_QUIET(devPaths, deps->count + 1) < 0) - return -1; - + devPaths =3D g_new0(char *, deps->count + 1); for (i =3D 0; i < deps->count; i++) { devPaths[i] =3D g_strdup_printf("/dev/block/%u:%u", major(deps->dev[i]), --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599824578; cv=none; d=zohomail.com; s=zohoarc; b=kMclnxAvm1jGW5xWegmwfcbxkmBRIVHN54ICRLVgjxvdfd55yzN4UzFVFwLx0coTK3fQJE5e7ILKWOqv50aILyvwUlkGFW8nGmR96t8vrakyMVjHOA/lPpVEtW0RAr/TB3piVLiij9Yu3GRd1yqvcqUwaxUc5Tb5MNg1O2LmyEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824578; 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=0K61hk51yda/azpRprnUpvz9HGN7XMYElXAUz2GetrQ=; b=DgzsLL7sD0a57TEc67gK3j/M2iFDTat70Ni71F6Si6ruV87T8yPW68yhewbbz9qTW0H82pDLR6eP2WFrvClpXe7kJ+YBwyLbBGV8AHYSyLD3LSzgneAmsrsyA1AdBB+dRAvdpP1/BCj8Ywch0ZE/95j257ZPbRT4VhcIILNGyC0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824578669183.46880392381559; Fri, 11 Sep 2020 04:42:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-eyIIxbB6Pa206B6RsKDmow-1; Fri, 11 Sep 2020 07:42:55 -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 7EA4C425D1; Fri, 11 Sep 2020 11:42:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F4B77FB93; Fri, 11 Sep 2020 11:42:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2D71F181A06E; Fri, 11 Sep 2020 11:42:49 +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 08BBglkI010752 for ; Fri, 11 Sep 2020 07:42:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5767B5DA2A; Fri, 11 Sep 2020 11:42:47 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04FAC5D9FC; Fri, 11 Sep 2020 11:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824577; 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=0K61hk51yda/azpRprnUpvz9HGN7XMYElXAUz2GetrQ=; b=MXrf1MwkDiY/8CXlEH2X0YgXzSkSaDzOquw5jjrGs8dfmIVyereeM1fRvYtyecWgcw3C45 JgZT+YoYB+Jv/KAKjdf2OOxL6u3PAEQPnoZ7E0q3XlvkqBUByF7JqhZzPUbJQJ4mklfe89 F+uVn+BsrdIJtAGZiAfFD8I2Uq7TmsQ= X-MC-Unique: eyIIxbB6Pa206B6RsKDmow-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 12/21] util: Use glib memory functions in virJSONValueGetArrayAsBitmap Date: Fri, 11 Sep 2020 13:42:09 +0200 Message-Id: <20200911114218.489636-13-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virjson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 6921eccb60..6511b4e641 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1243,8 +1243,8 @@ virJSONValueGetArrayAsBitmap(const virJSONValue *val, if (val->type !=3D VIR_JSON_TYPE_ARRAY) return -1; =20 - if (VIR_ALLOC_N_QUIET(elems, val->data.array.nvalues) < 0) - return -1; + /* elems might be NULL if val->data.array.nvalues is 0 */ + elems =3D g_new0(unsigned long long, val->data.array.nvalues); =20 /* first pass converts array members to numbers and finds the maximum = */ for (i =3D 0; i < val->data.array.nvalues; i++) { --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 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=1599824581; cv=none; d=zohomail.com; s=zohoarc; b=OrpRL3FKGBAQ7Kp4rhBMWU+MnFbDnTweadA5tWBSvfxlagi25TCP/giDdR1OM49G2m81icga+gxy+gKmC0L00coPUjnnWoCZj83zzXdTgnGthz1ot0meVdjPn5MMK56DtxST7OmloBzMP+o9P3oU8c8SGseCkBOTYhjjOXK4TAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824581; 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=gHzXy8wZY4tUh45pMo4QAIiA4+pqfIXm9TKE8PRQ2l8=; b=dd70UwApVx2Qfl8C41thbPQtIZKLXcgoTK8slfe2mt6rgxLnqDBMvY7+dOGErs/fjJRjPGndHfKqMzPL8vcX9cl0EqqFlACrg+tPlDiHnCzVtO0Ih3Yvub5uZlICF1+3beaqOojv30olmPd4RF6seHIk6rB7DsbKrgaTkkTnkXo= 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) header.from= 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 1599824581570816.4614148151728; Fri, 11 Sep 2020 04:43:01 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-137-Mq0NQHtUNk-DpaPnaFTzBA-1; Fri, 11 Sep 2020 07:42:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC48A425D8; Fri, 11 Sep 2020 11:42:51 +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 CD4547E8FC; Fri, 11 Sep 2020 11:42: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 96418181A270; Fri, 11 Sep 2020 11:42: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 08BBgmQY010761 for ; Fri, 11 Sep 2020 07:42:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6449A5D9E8; Fri, 11 Sep 2020 11:42:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA0A35D9F7; Fri, 11 Sep 2020 11:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824580; 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=gHzXy8wZY4tUh45pMo4QAIiA4+pqfIXm9TKE8PRQ2l8=; b=Ily+npbVgPdHqgE+jZZmvV7VCRIk0qFb+2C43JgihaJazz0wgKAv+HF2WtuT0eEQ4d3+Zr sUMX2joWJv1jTPx4/Xg4/2e5uFPzkYp462T267RCEcAqOcTHk3m/ZIYBTX/yhd7O95GQyo 5eBvuTTbq4ijuxoP6xECI9PHSYJPvEE= X-MC-Unique: Mq0NQHtUNk-DpaPnaFTzBA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 13/21] util: Remove VIR_ALLOC_N_QUIET Date: Fri, 11 Sep 2020 13:42:10 +0200 Message-Id: <20200911114218.489636-14-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/viralloc.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index ae967f2556..c60148724d 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -90,21 +90,6 @@ void virDisposeString(char **strptr) */ #define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count)) =20 -/** - * VIR_ALLOC_N_QUIET: - * @ptr: pointer to hold address of allocated memory - * @count: number of elements to allocate - * - * Allocate an array of 'count' elements, each sizeof(*ptr) - * bytes long and store the address of allocated memory in - * 'ptr'. Fill the newly allocated memory with zeros. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_ALLOC_N_QUIET(ptr, count) VIR_ALLOC_N(ptr, count) - /** * VIR_REALLOC_N: * @ptr: pointer to hold address of allocated memory --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599824581; cv=none; d=zohomail.com; s=zohoarc; b=MtRvruJsa2KMK8UYSFYED7WY1ZQCwv2VyoDN8Iuo8UrCM0yNa13Y6qWyESUrvjoa34S6NmPAL7hg1ZklmuOp3ZWiyd55jHJtM3K/kRelnZbHuG68Gkjo71iO15YTflWMBIQRyxtTZPAvmnVIrJwWj+JTjJB3ChK1RtW1IrpZMAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824581; 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=QdJVnutwdk1BiEGW+5graKSli7wrPAUEntlkHJ1axxw=; b=Ax3Jk+XdQwm59YTgvN0tYyv3TRpvCJgVspVCOvIvxKorcqXuXctl/Clo57LKa73tGgvEk/D7+kjb68m6oxARb7lyXe91tx2nFWe5rZGhKCUa3jYw1pdKGeojKOC/tfjJKYbrivH54sHxI0aBqAtYTJuq80dWagNgSzw8VnmeXwA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824581739585.0973718866866; Fri, 11 Sep 2020 04:43:01 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-2XGAMcQDNcmlRx9Z0Uxrrg-1; Fri, 11 Sep 2020 07:42:57 -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 092BB1007479; Fri, 11 Sep 2020 11:42: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 DD6795D9E8; Fri, 11 Sep 2020 11:42: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 ABFEF181A271; Fri, 11 Sep 2020 11:42: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 08BBgn78010773 for ; Fri, 11 Sep 2020 07:42:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 71E305DA2A; Fri, 11 Sep 2020 11:42:49 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7EB75D9E8; Fri, 11 Sep 2020 11:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824580; 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=QdJVnutwdk1BiEGW+5graKSli7wrPAUEntlkHJ1axxw=; b=QbrjmXdnKa5mCw0U7oNZTySgDK5HUPdAUhpiT3N8vuo95ZKY1x/yVCmiXRwFW7HLcF7g4s jsoJer43T/A41BM6bU/KWQ8xuPTsUQ+2sKt+ynOYzAXU8MUPWONAP+Aub97oY8Qj541w92 VI0BrQEv65EPmOPAvM4Trik0EP3Ba00= X-MC-Unique: 2XGAMcQDNcmlRx9Z0Uxrrg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 14/21] qemu: Use glib memory functions in qemuDomainMasterKeyReadFile Date: Fri, 11 Sep 2020 13:42:11 +0200 Message-Id: <20200911114218.489636-15-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0ed132a829..6efc6102bd 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -511,7 +511,7 @@ qemuDomainMasterKeyReadFile(qemuDomainObjPrivatePtr pri= v) goto error; } =20 - ignore_value(VIR_REALLOC_N_QUIET(masterKey, masterKeyLen)); + masterKey =3D g_renew(uint8_t, masterKey, masterKeyLen); =20 priv->masterKey =3D masterKey; priv->masterKeyLen =3D masterKeyLen; --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824583; cv=none; d=zohomail.com; s=zohoarc; b=NEPos94p/ixhv3VjtZOh8ccBBwNp1dDRxvCMDR9/EeH0s+NmFT8AF2aHqmcv9hpv4mn1QgpPsz/Ac+2cCuLnCqsTcR2ogS8BLzlJ26RzBVVyUgVXNUHsUB2QA3SUvfLylnQtO99o0hDm5Hgo9G9qXy7ujg4WMd2RjDyl3jmJYPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824583; 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=7lT+1YJUXL9CD1XYW8UwyeVSH2wEixU9G+8tpE7rnj0=; b=SwpgEVmU1dL0rYWwV5TQQXlMqlzp96RIQrfNxvis9CI59nZ33eagpB3H/+qq/25/DnHEj3O50aWkpU3yAs9hZlnszDcvA9tGWibSqAW1dmCJ3RbP8PgW1c92u89+C/SqY5a9x3+653uvMA/gGK7WhnbInoKmDothhXTZ9Oe5kcA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824583243172.3037140425672; Fri, 11 Sep 2020 04:43:03 -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-488-WherrNcKMA6Si9GvX70xQg-1; Fri, 11 Sep 2020 07:42:59 -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 83417425E5; Fri, 11 Sep 2020 11:42:54 +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 603205D9E8; Fri, 11 Sep 2020 11:42: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 2B8329230D; Fri, 11 Sep 2020 11:42: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 08BBgoYR010784 for ; Fri, 11 Sep 2020 07:42:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E5015D9FC; Fri, 11 Sep 2020 11:42:50 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id C449A5D9E8; Fri, 11 Sep 2020 11:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824582; 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=7lT+1YJUXL9CD1XYW8UwyeVSH2wEixU9G+8tpE7rnj0=; b=Op3plD32xJyocN662rD452UEBbM4IBwMlTRn9LCbVHobXrM/G0+RsiqZeDxTKvpKq7Yk6i OX86CiyNUBnXu9/MuTpoDRMwl+MQfn+wHnrVfL0sOM/c/GjSFjig0ShURevUhTDrd840qY jv2Pmq3coDp+k9ALn/ouDQc9VZosECQ= X-MC-Unique: WherrNcKMA6Si9GvX70xQg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 15/21] qemu: Use glib memory functions in qemuDomainLogContextRead Date: Fri, 11 Sep 2020 13:42:12 +0200 Message-Id: <20200911114218.489636-16-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6efc6102bd..785cee6f18 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6357,7 +6357,7 @@ ssize_t qemuDomainLogContextRead(qemuDomainLogContext= Ptr ctxt, =20 buf[got] =3D '\0'; =20 - ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); + buf =3D g_renew(char, buf, got + 1); buflen =3D got; } =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824587; cv=none; d=zohomail.com; s=zohoarc; b=MvgCeUJiswCzxbUTsUsZguX5Y75JzYy8IOgd8IhFbv4HajBgBMItqc0000P3Af2Z5Bh9j6DKKd44MdKw0zLje/WIZ5c3LQ/fNrKuZTRIvFkVMjuU7hYC++8y3Cuo5HY0rVD5nkwa+nGuvMncjIbvex8RsQgt/lIMKSVEWOauqww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824587; 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=VYMTNih6oH3zFO05/QZWlqYsI3i4/tmV4baHG3CbVrk=; b=LjDNXVfMnKMrfHjaQIK6LApNvYhu0pGGS4mXK6naSVjxAXC+XeGK23jClwDUWab0WxIqP4DIb7r4imhqmU5y+sRMZrDSAb3nuE+/MCmsiX4Iw4iFrzih+Dnoro7WHWPqQuIvU4QeGHK6t64235YF9NOIZL5hEmY7u9iJXpZDXO8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824587217755.0141329214865; Fri, 11 Sep 2020 04:43: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-530-kLGg1aNBOReOVCfay0Cx-Q-1; Fri, 11 Sep 2020 07:43:00 -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 8792180B736; Fri, 11 Sep 2020 11:42:54 +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 6899827CC1; Fri, 11 Sep 2020 11:42: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 3607C92315; Fri, 11 Sep 2020 11:42: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 08BBgp5H010795 for ; Fri, 11 Sep 2020 07:42:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D17D5DA2A; Fri, 11 Sep 2020 11:42:51 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id D38745D9E8; Fri, 11 Sep 2020 11:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824586; 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=VYMTNih6oH3zFO05/QZWlqYsI3i4/tmV4baHG3CbVrk=; b=G1tg4YNa9TPo1wYo6VYwMRWAPu1AIFCppaRFMtVTpXzSmqRxIJAMWDsNbSBRw0jC1lAkDx svHcpWnBUb50V3LxtTFQrDbZMaCiQ7jkfN3KZupHxiqDAb+wHS/tYZ91pN4Z3mrhMbr2NS 32N1jq3O9pJkjvq8CYfmGlCesR3Xy5Y= X-MC-Unique: kLGg1aNBOReOVCfay0Cx-Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 16/21] qemu: Use glib memory functions in qemuProcessReadLog Date: Fri, 11 Sep 2020 13:42:13 +0200 Message-Id: <20200911114218.489636-17-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dd60fb0ddf..b1af35b933 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2082,7 +2082,7 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, got -=3D skip; } =20 - ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); + buf =3D g_renew(char, buf, got + 1); *msg =3D buf; return 0; } --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 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=1599824586; cv=none; d=zohomail.com; s=zohoarc; b=ZtFVSR/6OGxM//jHhTRO63zP10FBONXGVFMas0SDEdNXj+SbeOcNcDrGIf8h1n4o49cizlxoa4fYIVnHMPfIdJjt01GdHGZtr7qvKpibzVZM/bABcwg5fb8eUZd5k2Ov4qc89xpiLR2db8pqSXQHHF75mryem/pevkyLRs53Q90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824586; 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=mPbR6ZtdLlOyzz2aa91t+rxjNZNmraifg6ygwrGErNg=; b=RxmeUW7BilD7fU9h3JFFTrHMP/V9AmTP5ZZqNUjDDNG5lHzO0JJaQGRe73fY53oHXFFuvo+CTxyTKB1CTJZUN2/Y6RI+HmGrXfmNe6wqhzZndBVmkDGw6rhv5pm9B9GgEkiDX6P4j/SN7w26so9Gz7SJS2EgY1zycfAVT1Nm6g0= 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) header.from= 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 1599824586335123.37172483600682; Fri, 11 Sep 2020 04:43:06 -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-491-VyiqdVg7OCyr_KvB3lSxQg-1; Fri, 11 Sep 2020 07:43:02 -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 D6D89100746F; Fri, 11 Sep 2020 11:42: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 BB8D181C42; Fri, 11 Sep 2020 11:42: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 895359231E; Fri, 11 Sep 2020 11:42:56 +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 08BBgq1p010812 for ; Fri, 11 Sep 2020 07:42:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id E0B2C5D9FC; Fri, 11 Sep 2020 11:42:52 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFF945DA2A; Fri, 11 Sep 2020 11:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824585; 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=mPbR6ZtdLlOyzz2aa91t+rxjNZNmraifg6ygwrGErNg=; b=DGm2NHBbm5oO7Ot0ekL57l1w1jEwJm79loXk975IdWxn7VHQ6EkDqYhpupkaNFkKlGaAFw xVNZBs82JEyOgaZI8MiLQXHkU1r1N4FTpcP81V7cE1ROtpDK5PS0SDJKD3VlREKqMpuy14 IBkaerKWQpRKim6nPMVWZ7FIjFV3UNE= X-MC-Unique: VyiqdVg7OCyr_KvB3lSxQg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 17/21] tests: Use glib memory functions in add_fd Date: Fri, 11 Sep 2020 13:42:14 +0200 Message-Id: <20200911114218.489636-18-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- tests/virpcimock.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 6b1f2f2a5a..c8aa8f3f01 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -305,11 +305,7 @@ add_fd(int fd, const char *path) fd, path, cb.fd, cb.path); } =20 - if (VIR_REALLOC_N_QUIET(callbacks, nCallbacks + 1) < 0) { - errno =3D ENOMEM; - return -1; - } - + callbacks =3D g_renew(struct fdCallback, callbacks, nCallbacks + 1); callbacks[nCallbacks].path =3D g_strdup(path); callbacks[nCallbacks++].fd =3D fd; =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1599824585; cv=none; d=zohomail.com; s=zohoarc; b=j/5fkPyhiwibCGDnZwVr+hupGBjZmU6JKC7fwCt+iJPfWpxxBh3QNGE+SYSNbABK3kTidtkHVJ+qw313unBmJUvVzcoKtTKGJr8bVUZ9D0UOG+DTNW58xN0B/MznyqzmHvd0eo4MkXoEJNYwq/+BNQjPoYTzcKr5boEf/PF8QOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824585; 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=TIs0TOg+MIPy3SQMDjhYKSAcJCG1UmOPV1Pr079ExIY=; b=UznaV9yrhI5ymXwTcYYdHAfXL3udNMSXEg08/+hGCfv9mH8bhwfMuW5I1OCUVvB+F3u+xoZP0jzZH8eFFewqxYV4GbgzKxuNg26uViFP8Z90f41t4TKaWtXSNQIqigEYnbsPE2PbG1g4Pu57/RBuupQ3pW3BXt49vf+9nxQLje0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599824585237382.450551361855; Fri, 11 Sep 2020 04:43:05 -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-515-ZzYWLCA6P1CCwJMHK3QoRw-1; Fri, 11 Sep 2020 07:43:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B5F5B100747C; Fri, 11 Sep 2020 11:42: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 939B17ED66; Fri, 11 Sep 2020 11:42: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 1C73292319; Fri, 11 Sep 2020 11:42:56 +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 08BBgrC9010822 for ; Fri, 11 Sep 2020 07:42:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF2185D9FC; Fri, 11 Sep 2020 11:42:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F4AE5D9E8; Fri, 11 Sep 2020 11:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824584; 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=TIs0TOg+MIPy3SQMDjhYKSAcJCG1UmOPV1Pr079ExIY=; b=XS0cwIvByrc/xdqimScxg9nXVo6qegJjbvw0wQYpSkzokZmzvrLiWq5IWEt5kzdpWAlNHS CRs8+a8xY287reQv4d2pceptHzfdHpPwhle9SrK9hL6nZpKP/yT/9caoli9ZLzNl4IipMq x//CsfTRZf3KUZVgbp7fy6F4VmZ6OlM= X-MC-Unique: ZzYWLCA6P1CCwJMHK3QoRw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 18/21] tests: Use glib memory functions in pci_driver_new Date: Fri, 11 Sep 2020 13:42:15 +0200 Message-Id: <20200911114218.489636-19-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- tests/virpcimock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index c8aa8f3f01..787172d24c 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -701,12 +701,12 @@ pci_driver_new(const char *name, ...) if ((device =3D va_arg(args, int)) =3D=3D -1) ABORT("Invalid vendor device pair for driver %s", name); =20 - if (VIR_REALLOC_N_QUIET(driver->vendor, driver->len + 1) < 0 || - VIR_REALLOC_N_QUIET(driver->device, driver->len + 1) < 0) - ABORT_OOM(); - + driver->vendor =3D g_renew(int, driver->vendor, driver->len + 1); driver->vendor[driver->len] =3D vendor; + + driver->device =3D g_renew(int, driver->device, driver->len + 1); driver->device[driver->len] =3D device; + driver->len++; } =20 --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1599824643; cv=none; d=zohomail.com; s=zohoarc; b=HZQHqnwWzXg46ltvaaON8RqY3n/uS8HSoaDQG+kD39Ch6K6Nf2ZtieMsJzPf+VeA/zIb4WKAhJnQ2B5RkoVVyF5EB8j0u3Nw7tCtRaiXh5di/2wHcN7q/7nyCoh9zhH2qCnUc6oPfSSrRsDHWRw3l9BCTzQF8ESPfdyb2fhwzB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824643; 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=R/udi+mtYxG1fLZVWjwmgdXnlzTyQuvc8YXES0qSxNU=; b=JfSvS8bTU7VhzqEUp7bJcp4cWC88WxeNEKZ+rxzYG5MStwHjkQ/pdA0WFKybIYsVO4qthJgSwFVVAywkROmp0kzQfCIyMG6QTYXswj6wfU3odDuhNo6zlJLDVDaQqOhUdUtHFg7KmN5/D8U5LGRQx9nmqJi1CfQZm5P2M/nzp/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599824643711310.2009743599533; Fri, 11 Sep 2020 04:44:03 -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-547-5XM1hOWMM7uLvIGvpItTYQ-1; Fri, 11 Sep 2020 07:43:05 -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 346CA1074661; Fri, 11 Sep 2020 11:42: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 18F5D7EB7C; Fri, 11 Sep 2020 11:42: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 D9478181A71E; Fri, 11 Sep 2020 11:42:58 +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 08BBgtNa010842 for ; Fri, 11 Sep 2020 07:42:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 072255D9FC; Fri, 11 Sep 2020 11:42:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D6945DA2A; Fri, 11 Sep 2020 11:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824642; 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=R/udi+mtYxG1fLZVWjwmgdXnlzTyQuvc8YXES0qSxNU=; b=CY1n3rEy//7f+2gKcuHezXJWYMNna4L07+4JJWIfJm/Mtt0aPowXqLACfg/Ai8VT2OFHfj TAOLCjNszWxEiLaLcgeH+KyCtlpnfonlUuTllyHuorhIg6ez+YojTnHNaPsEVo5jvAcsxk uePIGsV6HDOOl1pCjjNUIw6TrfDZfzk= X-MC-Unique: 5XM1hOWMM7uLvIGvpItTYQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 19/21] tools: Use glib memory functions in vshCompleterFilter Date: Fri, 11 Sep 2020 13:42:16 +0200 Message-Id: <20200911114218.489636-20-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 0e8edcd78c..e3c2404a74 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2709,13 +2709,11 @@ vshCompleterFilter(char ***list, return -1; =20 list_len =3D virStringListLength((const char **) *list); - - if (VIR_ALLOC_N(newList, list_len + 1) < 0) - return -1; + newList =3D g_new0(char *, list_len + 1); =20 for (i =3D 0; i < list_len; i++) { if (!STRPREFIX((*list)[i], text)) { - VIR_FREE((*list)[i]); + g_clear_pointer(&(*list)[i], g_free); continue; } =20 @@ -2723,8 +2721,8 @@ vshCompleterFilter(char ***list, newList_len++; } =20 - ignore_value(VIR_REALLOC_N_QUIET(newList, newList_len + 1)); - VIR_FREE(*list); + newList =3D g_renew(char *, newList, newList_len + 1); + g_free(*list); *list =3D newList; return 0; } --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 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=1599824590; cv=none; d=zohomail.com; s=zohoarc; b=ivE5242Hm00Z7lMD3d0xZwwMkbuUiATvTq+INgGZ83G3Rf3trLhm8S/52fha6Zs9OIN2phQdwakMhADxzsoYU7J2zWHUFyY3q10E27XuUQbOVAsbkmgDiFt3ChSlZ9XqrG4V8+a6X08YBbl9xEWniFz+4S62Lom0BiJUYdQOOoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824590; 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=j8sBNqYjNckVdA/Ihb10wlftA/ZJv9fVhSi7QhpVslM=; b=fLrgKRTgG+Nf/U/K1SQf8/BQ237Ap7/FEEF3O+SlMuUebwQXRIA3rTahCFtbtmKdchistFGr5O3rZg77Gswyy7c8jG2rH3PylPiMubBSuQA/AoEVem2+wCPtYAq2Ji/Dv0TfE/enjBd/iv3pIsGnSaU7A5QdTGf13b6hE8n/xn0= 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) header.from= 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 1599824590684545.3751414898928; Fri, 11 Sep 2020 04:43:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-9MMyH69RPw6VrU1tLRmoVA-1; Fri, 11 Sep 2020 07:43:07 -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 B6F0B80F041; Fri, 11 Sep 2020 11:43:01 +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 981CA5D9E8; Fri, 11 Sep 2020 11:43: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 637939231A; Fri, 11 Sep 2020 11:43:01 +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 08BBguab010853 for ; Fri, 11 Sep 2020 07:42:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0FDDC5D9FC; Fri, 11 Sep 2020 11:42:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58E9C5D9E8; Fri, 11 Sep 2020 11:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824589; 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=j8sBNqYjNckVdA/Ihb10wlftA/ZJv9fVhSi7QhpVslM=; b=R3zm422A84se7yTbEkuvRfy/mLd4zyya/WSN3AosHzfXubPnwxos2b2T6yGV1apRvb1aFH dgDtlShgospPw06Z70KmgzJ/XRMczTOs7BoJEYXbnWqo6tY8wcU+/5TXYrKe2h6d4mHYL+ 1x4jdV8QauNfCvpYJF/8LSnKa7p20f8= X-MC-Unique: 9MMyH69RPw6VrU1tLRmoVA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 20/21] util: Use glib memory functions in virFileGetXAttrQuiet Date: Fri, 11 Sep 2020 13:42:17 +0200 Message-Id: <20200911114218.489636-21-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/virfile.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 90156845df..61d2c16072 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4327,8 +4327,7 @@ virFileGetXAttrQuiet(const char *path, const char *name, char **value) { - char *buf =3D NULL; - int ret =3D -1; + g_autofree char *buf =3D NULL; =20 /* We might be racing with somebody who sets the same attribute. */ while (1) { @@ -4337,15 +4336,14 @@ virFileGetXAttrQuiet(const char *path, =20 /* The first call determines how many bytes we need to allocate. */ if ((need =3D getxattr(path, name, NULL, 0)) < 0) - goto cleanup; + return -1; =20 - if (VIR_REALLOC_N_QUIET(buf, need + 1) < 0) - goto cleanup; + buf =3D g_renew(char, buf, need + 1); =20 if ((got =3D getxattr(path, name, buf, need)) < 0) { if (errno =3D=3D ERANGE) continue; - goto cleanup; + return -1; } =20 buf[got] =3D '\0'; @@ -4353,10 +4351,7 @@ virFileGetXAttrQuiet(const char *path, } =20 *value =3D g_steal_pointer(&buf); - ret =3D 0; - cleanup: - VIR_FREE(buf); - return ret; + return 0; } =20 /** --=20 2.26.2 From nobody Sun Feb 8 14:50:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824649; cv=none; d=zohomail.com; s=zohoarc; b=Uh/TSz4zr65H1/xAVVF34OteAMPlT4KPkNRuS3oGaAGxswAhgJsbzAKAaYR8RzmgDc5At6ME4XsuqqbA+9XVp07Q6A+FOP6zxqeOVi5nviMmNYDLTF8j/9V5TeMs6FwSx8HmnY25Bw77Dm5beBN3tRsInkY0LJXBd6RFi1Bk6HE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824649; 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=9vnj1UQRU8YJ1OVdubxeoajacUZyeyhYf785mLYtD2o=; b=lJ28h4AyW5Ypw6qo7+aRvLB+Vm6RQsg/P/r5IaF1vmZD8t1RHXxCbfgEbNmqTuSBLDHtLdbF7mTbrOZgMIQAljFVswxynwBr2rHe2TEiFtJE10cdT2TCyT6kKyy6tWlbcWaJrZoq1e8hZSxveqzS0L+BQlO8WKG5yu1XdXPswP0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599824649827737.362765126605; Fri, 11 Sep 2020 04:44: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-201-TzTeSsynOhmlAUpSEZbF-A-1; Fri, 11 Sep 2020 07:43:10 -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 2CD9D425D9; Fri, 11 Sep 2020 11:43:04 +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 0E15360C87; Fri, 11 Sep 2020 11:43:04 +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 CA5B9181A86E; Fri, 11 Sep 2020 11:43: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 08BBgvMm010868 for ; Fri, 11 Sep 2020 07:42:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CDD65DA2A; Fri, 11 Sep 2020 11:42:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 623AF5D9E8; Fri, 11 Sep 2020 11:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824648; 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=9vnj1UQRU8YJ1OVdubxeoajacUZyeyhYf785mLYtD2o=; b=Oow/1/5C13M2M0HDQRCqo6KIABMWzSMolByFdBMQn2xHiUyxCzgSWRzmoM9PIW4KctY1b0 0DpU/ljwIjFKLkmdeJ5I9xit5eMg87GdGJZDYfIEbbYGr2C3GHHIq1lbe5xta1TBHxchKm qfawKr1Ivc1/LQKKkvly52V5QQ9gUng= X-MC-Unique: TzTeSsynOhmlAUpSEZbF-A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 21/21] util: Remove VIR_REALLOC_N_QUIET Date: Fri, 11 Sep 2020 13:42:18 +0200 Message-Id: <20200911114218.489636-22-twiederh@redhat.com> In-Reply-To: <20200911114218.489636-1-twiederh@redhat.com> References: <20200911114218.489636-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.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/util/viralloc.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index c60148724d..a50cd5d632 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -105,21 +105,6 @@ void virDisposeString(char **strptr) */ #define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (cou= nt)) =20 -/** - * VIR_REALLOC_N_QUIET: - * @ptr: pointer to hold address of allocated memory - * @count: number of elements to allocate - * - * Re-allocate an array of 'count' elements, each sizeof(*ptr) - * bytes long and store the address of allocated memory in - * 'ptr'. If 'ptr' grew, the added memory is uninitialized. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_REALLOC_N_QUIET(ptr, count) VIR_REALLOC_N(ptr, count) - /** * VIR_EXPAND_N: * @ptr: pointer to hold address of allocated memory --=20 2.26.2