From nobody Mon May 6 11:02:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571236624; cv=none; d=zoho.com; s=zohoarc; b=KsUBqJUn4M0Jn3auGXbQa4ggtl1DYhDveUz51ElAD3ThN4op8sbD0PoYTW5uoybxsOC1zMQlBrw1sUTpCPd21/GMfhB/O3Iei2x3IISx3o+7/u5IQE73ZGkNBi9pd8bMqjiN28wGA67B6o9AYyjJUgcrv0Ep4Ymx81J4Li3/xa4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571236624; h=Content-Type:Content-Transfer-Encoding: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=Ixk8RTaGvgT0LlJ7dj0bi2NLp4HIiR6XAOF7NsCD0+8=; b=XlIwXUwh9hvqXjhLZVlEGYZAy0yNlgRBaQWc+1PIBJHkap/yztsRr+KzQsW0VN6h0XYIZm2v6XVqBtnlEm/dFEN71M0vJjdxkSrItCxmCGlEXXSnY5HzS95zWq5s09Xh+GGWfhopS51pWMSZlvZvxcV14DcFolYkQFTlQrMvlik= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571236624288424.36085528813805; Wed, 16 Oct 2019 07:37:04 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6D6C410C095A; Wed, 16 Oct 2019 14:37:02 +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 3BF354C94; Wed, 16 Oct 2019 14:37:02 +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 F1A2418089DC; Wed, 16 Oct 2019 14:37:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GENr8u028002 for ; Wed, 16 Oct 2019 10:23:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 472D64C91; Wed, 16 Oct 2019 14:23:53 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-52.brq.redhat.com [10.40.200.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id AABD1194B6 for ; Wed, 16 Oct 2019 14:23:52 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 16:24:40 +0200 Message-Id: <69d2c7f395160e5860a6d46baa5aa3ef93b6ef06.1571235814.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] docs: hacking: separate section about already deleted macros 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 16 Oct 2019 14:37:03 +0000 (UTC) Move the recently deleted libvirt macros into a separate section. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- docs/hacking.html.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index de450b7cde..92826c5d44 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1029,6 +1029,15 @@ BAD: instead. Don't use g_vasprintf unless having the string length returned is unavoidable. =20 +
virStrerror
+
The GLib g_strerror() function should be used inste= ad, + which has a simpler calling convention as an added benefit.
+ + +

+ The following libvirt APIs have been deleted already: +

+
VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_AUTOFREE
The GLib macros g_autoptr, g_auto and g_autofree must be used instead in all new code. In existing code, the GLib macros must @@ -1051,10 +1060,6 @@ BAD:
The GLib macros g_autoptr and G_DEFINE_AUTOPTR_CLEANUP_FUNC should be used to manage autoclean of virObject classes. This matches usage with GObject classes.
- -
virStrerror
-
The GLib g_strerror() function should be used instead, - which has a simpler calling convention as an added benefit.
=20

File handling

--=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 11:02:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571235970; cv=none; d=zoho.com; s=zohoarc; b=VFIEG/BMv+qnp3wkkNMyvr5yFpb4RJUBOQIPZwrcruslQNbzY4D85V1h/+eEi7A4Y4JYkJXjaMCK6lf1ER0wtxr6LHn6oLmCQovyCZGiOaQXQ4yqMRIhC859YfQX4hNqK6M0ixamYtT7Y64kkUYyCbV+M+RAWoL/8xF5KcB9hmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571235970; h=Content-Type:Content-Transfer-Encoding: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=K0F5xkdi5SeHCQta2Q4K4RPQqdrD+YKUhRK4iRmicDU=; b=g4WKM0z+MoFTVMZPVAlxKtv4EOct1rF0U7z1zySRM2jRPDL+iDV51ANi/EbG4SvDVkUPzH73zyhel0YxSyz1A8drAn/PxFTeY/n3UFWXtlnQx+BQntyiiE/ljloeZ3teUODNwfb6ha8d+u3OotLOnH78g1TTo0+WIyHM7B7BECw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571235970924745.5092539972711; Wed, 16 Oct 2019 07:26:10 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 301272CE95A; Wed, 16 Oct 2019 14:26:09 +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 E436260C80; Wed, 16 Oct 2019 14:26:08 +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 824FC1803B48; Wed, 16 Oct 2019 14:26:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GENsEh028013 for ; Wed, 16 Oct 2019 10:23:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 516DB4C99; Wed, 16 Oct 2019 14:23:54 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-52.brq.redhat.com [10.40.200.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABC154C98 for ; Wed, 16 Oct 2019 14:23:53 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 16:24:41 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] docs: hacking: use for functions/names 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 16 Oct 2019 14:26:09 +0000 (UTC) Use the element more in the GLib section. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- docs/hacking.html.in | 47 ++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 92826c5d44..ecf52ffc17 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1008,28 +1008,32 @@ BAD:

=20
-
VIR_ALLOC, VIR_REALLOC, VIR_RESIZE_N, VIR_EXPAND_N, - VIR_SHRINK_N, VIR_FREE, VIR_APPEND_ELEMENT, VIR_INSERT_ELEMENT, - VIR_DELETE_ELEMENT
-
Prefer the GLib APIs g_new0/g_renew/g_free in most cases. - There should rarely be a need to use g_malloc/g_realloc. +
VIR_ALLOC, VIR_REALLOC, + VIR_RESIZE_N, VIR_EXPAND_N, + VIR_SHRINK_N, VIR_FREE, + VIR_APPEND_ELEMENT, VIR_INSERT_ELEMENT, + VIR_DELETE_ELEMENT
+
Prefer the GLib APIs g_new0/g_renew/ + g_free in most cases. There should rarely be a need + to use g_malloc/g_realloc. Instead of using plain C arrays, it is preferrable to use - one of the GLib types, GArray, GPtrArray or GByteArray. These + one of the GLib types, GArray, GPtrArray + or GByteArray. These all use a struct to track the array memory and size together and efficiently resize. NEVER MIX use of the classic libvirt memory allocation APIs and GLib APIs within a single method. Keep the style consistent, converting existing code to GLib style in a separate, prior commit.
=20 -
VIR_STRDUP, VIR_STRNDUP
-
Prefer the GLib APIs g_strdup and g_strndup.
+
VIR_STRDUP, VIR_STRNDUP
+
Prefer the GLib APIs g_strdup and g_strndup.
=20 -
virAsprintf, virVasprintf
-
The GLib APIs g_strdup_printf / g_strdup_vprint should be used - instead. Don't use g_vasprintf unless having the string length +
virAsprintf, virVasprintf
+
The GLib APIs g_strdup_printf / g_strdup_vpri= nt should be used + instead. Don't use g_vasprintf unless having the stri= ng length returned is unavoidable.
=20 -
virStrerror
+
virStrerror
The GLib g_strerror() function should be used inste= ad, which has a simpler calling convention as an added benefit.
@@ -1038,26 +1042,27 @@ BAD: The following libvirt APIs have been deleted already:

-
VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_AUTOFREE
-
The GLib macros g_autoptr, g_auto and g_autofree must be used +
VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_= AUTOFREE
+
The GLib macros g_autoptr, g_auto and + g_autofree must be used instead in all new code. In existing code, the GLib macros must never be mixed with libvirt macros within a method, nor should - they be mixed with VIR_FREE. If introducing GLib macros to an + they be mixed with VIR_FREE. If introducing GLib macr= os to an existing method, any use of libvirt macros must be converted in an independent commit.
=20 -
VIR_DEFINE_AUTOPTR_FUNC, VIR_DEFINE_AUTOCLEAN_FUNC
-
The GLib macros G_DEFINE_AUTOPTR_CLEANUP_FUNC and - G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC must be used in all +
VIR_DEFINE_AUTOPTR_FUNC, VIR_DEFINE_AUTOCLEAN= _FUNC
+
The GLib macros G_DEFINE_AUTOPTR_CLEANUP_FUNC and + G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC must be used in all new code. Existing code should be converted to the new macros where relevant. It is permissible to use - g_autoptr, g_auto on an object whose cleanup function + g_autoptr, g_auto on an object whose cle= anup function is declared with the libvirt macros and vice-verca.
=20 -
VIR_AUTOUNREF
-
The GLib macros g_autoptr and G_DEFINE_AUTOPTR_CLEANUP_FUNC +
VIR_AUTOUNREF
+
The GLib macros g_autoptr and G_DEFINE_AUTOPT= R_CLEANUP_FUNC should be used to manage autoclean of virObject classes. This matches usage with GObject classes.
--=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 11:02:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571235975; cv=none; d=zoho.com; s=zohoarc; b=Pk04UDTOA2yfwZqYwoSlSJOzNnV6wIN6wJr3G1IoQskRz6UJ8z2tAMHJn+R5W+XLKUYL9qJ8INNVExZI6AY9SyupAKb9j+QxOA0JlRr12lANFCWjgdveX00kv7HCXnepZ6xGeR1nJ7GXTfxR8Xqs1J107/oJ+fpqShcNdL7fAe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571235975; h=Content-Type:Content-Transfer-Encoding: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=QKC1eu4ZhWCoW91aVkFGNmu9d1DEryYLxqXsFyfg2Wo=; b=VvKU7pz/aKf0VPB6NROnI4yihXQIf1hgrPMjJbmscV1Lm/ZOxN8eOmJmYDDvg+bRAr/c2MyNgeHa9HjTRLD7+ykBEgh0cqSnGpIdLOhMEjsSR+/kZxwC+Lhce5k/WgNUOQXarugJ5qWgucYgvJch5iKKt5LA1j+InoqKAdcT/SM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571235975571439.954658047336; Wed, 16 Oct 2019 07:26:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D8FD210C0947; Wed, 16 Oct 2019 14:26:13 +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 A942810018F8; Wed, 16 Oct 2019 14:26:13 +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 4D736180B761; Wed, 16 Oct 2019 14:26:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GENtJA028028 for ; Wed, 16 Oct 2019 10:23:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 63C50A7CD; Wed, 16 Oct 2019 14:23:55 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-52.brq.redhat.com [10.40.200.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1111194B2 for ; Wed, 16 Oct 2019 14:23:54 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 16:24:42 +0200 Message-Id: <0cf775d1d041d819497793f0c9bfb1a8226d9730.1571235814.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] docs: hacking: add a conversion table for removed libvirt macros 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 16 Oct 2019 14:26:14 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- docs/hacking.html.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index ecf52ffc17..3b66c16761 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1066,6 +1066,19 @@ BAD: should be used to manage autoclean of virObject classes. This matches usage with GObject classes. + + + + + + + + + + + +
deleted versionGLib versionNotes
VIR_AUTOPTRg_autoptr
VIR_AUTOCLEANg_auto
VIR_AUTOFREEg_autofree<= /td>The GLib version does not use parentheses
VIR_AUTOUNREFg_autoptr<= /td>The cleanup function needs to be defined
VIR_DEFINE_AUTOPTR_FUNCG_DEFIN= E_AUTOPTR_CLEANUP_FUNC
VIR_DEFINE_AUTOCLEAN_FUNCG_DEF= INE_AUTO_CLEANUP_CLEAR_FUNC
VIR_STEAL_PTRg_steal_pointera =3D f(&b) instead of f(a, b)
VIR_RETURN_PTRreturn g_steal_p= ointer
+ =20

File handling

=20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list