From nobody Mon Feb 9 19:04:43 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-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=1578699197; cv=none; d=zohomail.com; s=zohoarc; b=cvS0hhTRrv62I904uudCiRX5h7RVl15cO/RTOkPcT1GUlUinrkIB01s8V/AQw6rqxfIbc9yryO6HZMmbxdLvsDeE20TW5taQozcHxSwCm6sEZ5XqEqaAeXpC01zp0WNqmJA2uIu22nRjC3Ka5WBCc3QmBd19AoKmyJ09G+T/c0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578699197; 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=GcZ6ZuyeHLUYgwcN3btOie2HDVdfT+3FSD4D2VzFKPk=; b=RA2izxOa+/HNb7xAOjCrBdG57S6jU3PLzXrhtg5GVcQ+k8RjK6dnJSsEW7X96HdSFp/Rq7kmH9feOyRAbxV67r69naHd6OID/Qh5ry8tMIZ9wNHr4Tw/whTp/mgAwsux15JsZZjkOtfOzw4xn2BVob47Z2YERzYkQi6C3Shv9Jo= 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578699197411891.0978403477558; Fri, 10 Jan 2020 15:33:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-8rlPKpU0NAeS_9lW7dw_4A-1; Fri, 10 Jan 2020 18:33:12 -0500 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 DA08F800D4C; Fri, 10 Jan 2020 23:33:04 +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 B28A087EC1; Fri, 10 Jan 2020 23:33: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 6BC93820EE; Fri, 10 Jan 2020 23:33:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00ANWPe9018768 for ; Fri, 10 Jan 2020 18:32:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 058017C408; Fri, 10 Jan 2020 23:32:25 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-117-214.phx2.redhat.com [10.3.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5CEE5D72B; Fri, 10 Jan 2020 23:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578699196; 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=GcZ6ZuyeHLUYgwcN3btOie2HDVdfT+3FSD4D2VzFKPk=; b=PP65HBsJ4sbJt8bBtYcJcHAvGcnWRlSu+2naXLUfWoWETwVnhvMJL2aeAEAEWshNTPjNMe 3KSx2f8KgQzjQ/i6IK+pyjygRYICGoCLdWB+i6sUNxR9IdwvZfMFVdQZt4yUtWFv3JCWuU gqW5nZ/R23gbZRs9H3M/orinpv7YwX0= From: Jonathon Jongsma To: libvir-list@redhat.com Date: Fri, 10 Jan 2020 17:32:17 -0600 Message-Id: <20200110233217.18770-9-jjongsma@redhat.com> In-Reply-To: <20200110233217.18770-1-jjongsma@redhat.com> References: <20200110233217.18770-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com Subject: [libvirt] [PATCH v2 8/8] Use glib alloc API for virDomainFSInfo X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 8rlPKpU0NAeS_9lW7dw_4A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma --- src/libvirt-domain.c | 12 ++++++------ src/qemu/qemu_driver.c | 18 +++++------------- src/remote/remote_daemon_dispatch.c | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index eb66999f07..33c0e1949d 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11924,15 +11924,15 @@ virDomainFSInfoFree(virDomainFSInfoPtr info) if (!info) return; =20 - VIR_FREE(info->mountpoint); - VIR_FREE(info->name); - VIR_FREE(info->fstype); + g_free(info->mountpoint); + g_free(info->name); + g_free(info->fstype); =20 for (i =3D 0; i < info->ndevAlias; i++) - VIR_FREE(info->devAlias[i]); - VIR_FREE(info->devAlias); + g_free(info->devAlias[i]); + g_free(info->devAlias); =20 - VIR_FREE(info); + g_free(info); } =20 /** diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 812ff45707..f905ef4675 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -21849,17 +21849,14 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, size_t i; virDomainDiskDefPtr diskDef; =20 - if (VIR_ALLOC(ret) < 0) - goto error; + ret =3D g_new0(virDomainFSInfo, 1); =20 ret->mountpoint =3D g_strdup(agent->mountpoint); ret->name =3D g_strdup(agent->name); ret->fstype =3D g_strdup(agent->fstype); =20 - if (agent->disks && - VIR_ALLOC_N(ret->devAlias, agent->ndisks) < 0) - goto error; - + if (agent->disks) + ret->devAlias =3D g_new0(char *, agent->ndisks); ret->ndevAlias =3D agent->ndisks; =20 for (i =3D 0; i < ret->ndevAlias; i++) { @@ -21875,10 +21872,6 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, } =20 return ret; - - error: - virDomainFSInfoFree(ret); - return NULL; } =20 /* Returns: 0 on success @@ -21896,8 +21889,7 @@ virDomainFSInfoFormat(qemuAgentFSInfoPtr *agentinfo, =20 if (nagentinfo < 0) return ret; - if (VIR_ALLOC_N(info_ret, nagentinfo) < 0) - goto cleanup; + info_ret =3D g_new0(virDomainFSInfoPtr, nagentinfo); =20 for (i =3D 0; i < nagentinfo; i++) { if (!(info_ret[i] =3D qemuAgentFSInfoToPublic(agentinfo[i], vmdef)= )) @@ -21915,7 +21907,7 @@ virDomainFSInfoFormat(qemuAgentFSInfoPtr *agentinfo, if (info_ret) virDomainFSInfoFree(info_ret[i]); } - VIR_FREE(info_ret); + g_free(info_ret); return ret; } =20 diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 9c294ddc39..70fdb7f36b 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -7032,7 +7032,7 @@ remoteDispatchDomainGetFSInfo(virNetServerPtr server = G_GNUC_UNUSED, if (ninfo >=3D 0) for (i =3D 0; i < ninfo; i++) virDomainFSInfoFree(info[i]); - VIR_FREE(info); + g_free(info); =20 return rv; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list