[PATCH] docs: remove references to removed APIs

Daniel P. Berrangé via Devel posted 1 patch 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20250317100417.18647-1-berrange@redhat.com
docs/glib-adoption.rst | 22 ----------------------
1 file changed, 22 deletions(-)
[PATCH] docs: remove references to removed APIs
Posted by Daniel P. Berrangé via Devel 9 months ago
The glib adoption docs was suggesting avoidance of certain APIs that
were obsoleted by glib, during the transition period. Now that the
referenced APIs no longer exist in libvirt code, they can also be
removed from the docs.

NB, the virStringListRemoveDuplicates method remains since there is
no glib equivalent.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/glib-adoption.rst | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/docs/glib-adoption.rst b/docs/glib-adoption.rst
index f969ac80a1..046cd821f7 100644
--- a/docs/glib-adoption.rst
+++ b/docs/glib-adoption.rst
@@ -14,19 +14,6 @@ the GLib APIs straight away where possible.
 The following is a list of libvirt APIs that should no longer be
 used in new code, and their suggested GLib replacements:
 
-Memory allocation
-   ``VIR_ALLOC``, ``VIR_REALLOC``, ``VIR_RESIZE_N``,
-   ``VIR_EXPAND_N``, ``VIR_SHRINK_N``, ``VIR_FREE``
-
-   https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html
-
-   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``. **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.
-
 Array operations
    ``VIR_APPEND_ELEMENT``, ``VIR_INSERT_ELEMENT``, ``VIR_DELETE_ELEMENT``
 
@@ -37,15 +24,6 @@ Array operations
    These all use a struct to track the array memory and size
    together and efficiently resize.
 
-String arrays
-   ``virStringList*``, ``virStringListCount*``
-
-   https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html
-
-   Prefer the NULL-terminated variant instead of storing the count
-   separately. Prefer ``g_str*v`` functions instead of their ``vir*``
-   counterparts. For use with ``g_auto`` GLib provides the ``GStrv`` type.
-
 Objects
    ``virObject``
 
-- 
2.48.1
Re: [PATCH] docs: remove references to removed APIs
Posted by Pavel Hrdina via Devel 9 months ago
On Mon, Mar 17, 2025 at 10:04:17AM +0000, Daniel P. Berrangé via Devel wrote:
> The glib adoption docs was suggesting avoidance of certain APIs that
> were obsoleted by glib, during the transition period. Now that the
> referenced APIs no longer exist in libvirt code, they can also be
> removed from the docs.
> 
> NB, the virStringListRemoveDuplicates method remains since there is
> no glib equivalent.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  docs/glib-adoption.rst | 22 ----------------------
>  1 file changed, 22 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>