[PATCH 05/10] util: json: Remove 'virJSONValueObjectReplaceValue'

Peter Krempa posted 10 patches 12 months ago
[PATCH 05/10] util: json: Remove 'virJSONValueObjectReplaceValue'
Posted by Peter Krempa 12 months ago
The helper was used only in 'qemucapabilitiesnumbering' test which was
removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/libvirt_private.syms |  1 -
 src/util/virjson.c       | 20 --------------------
 src/util/virjson.h       |  6 ------
 3 files changed, 27 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index fc26109029..eba5a45343 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2665,7 +2665,6 @@ virJSONValueObjectHasKey;
 virJSONValueObjectKeysNumber;
 virJSONValueObjectPrependString;
 virJSONValueObjectRemoveKey;
-virJSONValueObjectReplaceValue;
 virJSONValueObjectStealArray;
 virJSONValueObjectStealObject;
 virJSONValueToBuffer;
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 03c3b6cfb9..57707350da 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1136,26 +1136,6 @@ virJSONValueObjectGetString(virJSONValue *object,
 }


-void
-virJSONValueObjectReplaceValue(virJSONValue *object,
-                               const char *key,
-                               virJSONValue **newval)
-{
-    size_t i;
-
-    if (object->type != VIR_JSON_TYPE_OBJECT ||
-        !*newval)
-        return;
-
-    for (i = 0; i < object->data.object.npairs; i++) {
-        if (STREQ(object->data.object.pairs[i].key, key)) {
-            virJSONValueFree(object->data.object.pairs[i].value);
-            object->data.object.pairs[i].value = g_steal_pointer(newval);
-        }
-    }
-}
-
-
 /**
  * virJSONValueObjectGetStringOrNumber:
  * @object: JSON value object
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 95b8b14ae6..e622798fe7 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -241,12 +241,6 @@ virJSONValueObjectRemoveKey(virJSONValue *object,
                             virJSONValue **value)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

-void
-virJSONValueObjectReplaceValue(virJSONValue *object,
-                               const char *key,
-                               virJSONValue **newval)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-
 int
 virJSONValueArrayAppendString(virJSONValue *object,
                               const char *value);
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 05/10] util: json: Remove 'virJSONValueObjectReplaceValue'
Posted by Andrea Bolognani 11 months, 3 weeks ago
On Tue, Jan 16, 2024 at 05:12:39PM +0100, Peter Krempa wrote:
> The helper was used only in 'qemucapabilitiesnumbering' test which was
> removed.
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/libvirt_private.syms |  1 -
>  src/util/virjson.c       | 20 --------------------
>  src/util/virjson.h       |  6 ------
>  3 files changed, 27 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org